Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Senior Coder crmpicco's Avatar
    Join Date
    Jan 2005
    Location
    Mauchline, Scotland
    Posts
    1,096
    Thanks
    15
    Thanked 1 Time in 1 Post

    Unhappy window.location.reload(false);

    Code:
    function refresh()
    {
        window.location.reload(false);
    }
    i have this function that i use on a onClick. is there anyway to bypass the preceeding 'retry' button
    (a message box asking you if you want to send the information again. the "Retry" button) or automatically click it?

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,048
    Thanks
    0
    Thanked 251 Times in 247 Posts
    No. It happens because the page was the result of a POST submission. You can change the method to GET but that will show the submitted data in the URL.

  • #3
    Regular Coder martin_narg's Avatar
    Join Date
    Jul 2002
    Location
    Chamonix, France
    Posts
    600
    Thanks
    1
    Thanked 3 Times in 3 Posts
    You can use this:
    Code:
    document.location.href = document.location.href;
    However be warned of the pitfalls associated with it! The page will perform a "hard reload" so essentially it will be like viewing the page for the first time.

    Using the reload() method is a "soft refresh" of the page, in that form input is saved/forms are reposted etc.

    m_n
    "Cos it's strange isn't it. You stand in the middle of a library and go 'Aaaaaaaaaaaaaaaaggggggghhhhhhh!'
    and everybody just stares at you. But you do the same in an aeroplane, and everybody joins in."
    -Tommy Cooper

  • #4
    Senior Coder crmpicco's Avatar
    Join Date
    Jan 2005
    Location
    Mauchline, Scotland
    Posts
    1,096
    Thanks
    15
    Thanked 1 Time in 1 Post

    Thumbs down window.location on a confirm box

    Code:
    var answer = confirm("You will be redirected to the Flight Search screen");
    				if(answer)
    				{
    					window.location="airbook.asp";
    				}
    				else
    				{
    					window.location="airbook.asp";
    				}
    Is there a shorter way to code this?
    Basically i want a confirm pop-up that will go to
    airbook.asp no matter what button you click?

    TIA.

    Picco

  • #5
    Regular Coder martin_narg's Avatar
    Join Date
    Jul 2002
    Location
    Chamonix, France
    Posts
    600
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Why use confirm when the user is being directed anyway?
    Code:
    alert("You will be redirected to the Flight Search screen");
    document.location = "airbook.asp";
    "Cos it's strange isn't it. You stand in the middle of a library and go 'Aaaaaaaaaaaaaaaaggggggghhhhhhh!'
    and everybody just stares at you. But you do the same in an aeroplane, and everybody joins in."
    -Tommy Cooper


  •  

    Posting Permissions

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