window.location.href is not working under IE 7/8/9
Hi ,
I am using java script to provide a page to the client, in the page there are two checkboxes, i.e. "All countries" and "Asian Countries", so when i check the checkbox "Asian Countries" and click replot button, the page displays only asain counties but after some specific when the page reloads , it displays all other countries along with asian countries, and the checkbox "Asian Countries" is still selected, what i want is that after the page reloads it should display only the countries for which the checkbox was selected before. i am using window.location.href for providing the URL i.e.
the above works fine under firefox and other browsers but not under IE 7/8/9 and we need it to work on IE. also i have already tried the below alternatives but issue not solved.
location.href
event.preventDefault()
return false
and document.write(window.location.href)
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
Hi thanks for the reply,
I have tried it, but when the page reloads after the refresh timer reaches zero, then the checkbox 0 (zero) is selected by default and shows all the countries, and the checkbox 1 is deselected . i want that when the page reloads it should reload with the same options selected as before.
Does the page linked-to at filename.html?gmlat= use a script to dynamically select the checkboxes?
If so, then visiting just filename.html (without the query-string) may not do this (unless there is some more script involved on that page). In which case, whether the boxes are checked, or unchecked, is entirely dependent on the browser and, for some, their settings. This behaviour is not defined: that is, it cannot be depended upon.
In which case, a script would be needed that will store, and retrieve, the current checked-state(s) in (usually) a cookie.
[I'm guessing that the boxes are only checked currently because this is how FF and the other browsers behave.]
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
Last edited by AndrewGSW; 12-10-2012 at 08:52 PM..
Oh...nice. Only think I can think of is to make sure you really only have the "plotOpt" fields you expect to have.
Okay...one more thing.
Since you are, indeed, doing locaton.href that means you *SHOULD* be able to simply look at the browser's address bar and read exactly what it is the browser is seeing as the URL.
So do that, both with MSIE and another browser, and compare them.
If they look the same, then copy one (or both) here for us to look at.
In other words, let's get JS our of the way as much as possible first, and only then go back to it, as needed.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
You have probably to read the new URI (Try an alert (decodeURIComponent(window.location.search)) ) and to use (after a window onload) the corresponding data to reset your lists with javascript. The same string could be simultaneously stored in a cookie...