Javascript page reload with cross browser compatibility
This one stumped me for awhile because everyone seems to have their preferred method of doing page reloads using only javascript. After trying several, I was having compatibility issues with firefox 3.5 on windows. Javascript is pain in the ass sometimes (most of the time) when you have to worry about all the major browsers.
Here’s the best solution I could find and, after testing, it appears to work on all major browsers. I didn’t write it, but I found it buried in StackOverflow
This is what I originally tried, but it doesn’t work on FireFox 3.5:
document.location.reload(true);
This works on all major browsers including FireFox 3.5
window.location.href = location.href + "?" + Date.parse(new Date());
Source: stackoverflow.com
1 Notes/ Hide
-
r4vi reblogged this from alexkehayias and added:
should be pretty cross browser too. Even really old crappy ones. var meta; if (document.createElement && (meta
-
alexkehayias posted this