Hello
I'm testing things with javascript history.go() function. I'm getting different behavior from different browsers. I wanna know if there's a workout around this.
history.go(-1) supposed to go back which does in all of the browsers but it doesn't show the data changed with js in most browsers. here's a sample code which works in ff but not ie or chrome:
some page to go back to:
next.html just to redirect back:Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <body> <script type="text/javascript"> function changeMe() { div = document.createElement('div'); div.innerHTML = '<input id="something" type="text" name="something" />'; document.getElementById('change').appendChild(div); } </script> <div id="change"></div> <a href="javascript: void(0);" onclick="javascript: changeMe();">Add input</a> <a href="javascript: void(0);" onclick="document.getElementById('something').value = '12312313'">Put value in input</a> <a href="next.html">Goto next page</a> </body> </html>
Now when going back to the page with FF (also opera and safari), it shows both the inserted input AND the value we put in it. but with chrome and IE they do not show neither the inserted div and the value. In other words they won't show the changes js made to the page.Code:<a href="Javascript: history.go(-1);">go back</a>
I was wondering if it is possible to make them remember the changes that js made?



Reply With Quote
Bookmarks