Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refreshing cookies without a page reload...

Status
Not open for further replies.

theomen

Programmer
Jun 2, 2004
158
GB
Hi,

I'm having a problem installing currency conversion into a web page.

The service we are using works by "including" 2 javascripts that are based on the suppliers server. Therefore, we can't access/change these scripts.

If a visitor wants to change their currency, they click a link, which pops up a new window, they select their currency, hit change, and the window closes. The problem is, it then reloads the original page, which contains a form. If the user has completed all their details in the form, then changes their details, when the page reloads, all the info they entered is lost (the page is coded in ASP).

I've managed to stop the page reloading, but then it doesn't change the currency. I believe the selected currency is stored in a cookie, but I can't access this cookie.

Is there a way to refresh all cookies on a page without reloading the page? I have found another work around, which is to submit the form to the same page, the values of the fields then come from the submission. However, some fields are populated from the querystring or other places, which causes a problem.

Any advice would be much appreciated.
 
try using a hidden iframe, which will call a script that will fetch the cookie, return it and then with javascript update the field in the form.

hope this helps...

(-:
 
Thanks for the reply stakadush.

I was actually considering that, but I don't want to mess too much with the page as it can get information from various different sources, it wasn't written by me originally, and I've only just started working here so I'm scared of breaking other peoples code too much :)

I've actually just realised anyway that the service we were using for providing the currency service don't support Mozilla Firefox, and their javascript doesn't work in it, so its pretty pointless to us.

So I'm now looking at other options, including parsing the daily exchange rates from an xml page I've found that is updated daily. That way I can build the currency converter myself, and have full control over how it works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top