SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jul 2011
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Chrome and Firefox reload the page on back event

    Hi guys,

    We are developing an application with ASP.Net and C#. We have a back button (html link) on few pages, by clicking on back button it triggers the browser back event. So user will be able to see his last viewed results (by going only one level back).

    We are calling "window.history.back();" function of Javascript to achieve this, but the problem is that its working fine in IE but not in Chrome and Firefox. Whenever user clicks on the back button, Chrome and Firefox reloads the page from server and execute all the server side events.

    What we need is simply go to one step back without reloading or refreshing the page.

    Please help...

    Thank you for your time and help...

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,705
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by dev_ View Post
    We are calling "window.history.back();" function of Javascript to achieve this, but the problem is that its working fine in IE but not in Chrome and Firefox. Whenever user clicks on the back button, Chrome and Firefox reloads the page from server and execute all the server side events.

    What we need is simply go to one step back without reloading or refreshing the page.
    Whenever you have a state that you want people to be able to go back to, that is when you should set a fragment identifier in the address bar. Web browsers will go back through those different fragment identifiers that you set, and you can then take action on the page based on the what is currently in the url.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Tags for this Thread

Bookmarks

Posting Permissions

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