Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2008
    Thanked 9 Times in 9 Posts

    document.location.reload(true) vs. regular refresh

    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
    Last edited by hotwheelharry; 11-17-2010 at 09:21 AM.

  • #2
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Some say it's everything.
    Thanked 397 Times in 390 Posts
    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.


    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)?
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts