...

View Full Version : document.location.reload(true) vs. regular refresh



hotwheelharry
11-17-2010, 08:03 AM
Is there a difference between right clicking an iframe and reloading post reponse vs. using javascript to reload the frame?

So far, the javascript route hasn't worked for me.

[some context]
I am writing a little bookmarklet to help me with the online registrations at my school. Here is the setup.

Load up a page on the domain.
Remove all body elements.
Insert an iframe.
Set iframe to page for class roster search.
(in iframe on school search page) Select class search options, POST the form data, and view results in frame.

*This works perfectly, but I need to have it refresh results every minute or so.
When I use frame.contentDocument.location.reload(true); the frame loses the post data or something and the page is broken.
BUT when I just right click on the frame and select "reload frame" it works perfectly.

Whats the deal here?
What is the difference between rightclicking the frame and refreshing it like that vs. using javascript to reload the frame?

PS: using chrome

Rowsdower!
11-17-2010, 04:05 PM
I'm not sure why it would do that. I believe it is supposed to be 1:1 with the reload button on the browser, which would re-post the data.

BUT...

Even if you succeed in getting the reload to re-post the data I'm pretty sure that the user will (or at least "should") get a browser alert box asking if they want to send the post data again every single time the reload occurs. That will wreck your user interface and user experience, so it's probably not worth wrestling with the current issue.

Can you switch over to a GET structure on the target page (the class search page)?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum