jQuery Back Button (go to previous page)

Sam Deering

jQuery/JavaScript code snippet to simulate a back button based on the users last web page.

		return false;

Free JavaScript: Novice to Ninja Sample

Get a free 32-page chapter of JavaScript: Novice to Ninja and receive updates on exclusive offers from SitePoint.

  • Pingback: jQuery Back Button (go to previous page) « Big Engine Media

  • http://www.ChiefAlchemist.com Mark “Chief Alchemist” Simchock

    Simply yet helpful, thanks.

    But what if there is no history? For example, the page’s URL is shared via social media. Might there be an easy way to suppress the displaying the link that is assigned the .back?

  • http://www.ChiefAlchemist.com Mark “Chief Alchemist” Simchock
  • http://technoslab.blogspot.com Manish

    Very useful and handy.

  • ksankalpa

    thanks a lot ,,common solution for most problems

  • mimi

    Letter Registration Form
    function goBack () { history.go(-1); return false; }

    Search By :

    (please select Your choice:…)


    Tarikh Penerimaan
    No.Fail Kementerian Ibu Pejabat
    Nombor-Nombor yang lain
    Tarikh Surat
    Daripada siapa
    Dirujukkan kepada
    Dokumen difailkan


















































    //this mycode idon’t why button back not function..

  • mimi

    not that one..sory..this one…

    KandunganForm Kandungan/Content :  

  • chandu

    history.back(); also working for mee

  • Gary

    Thanks Sam, please could you let me know where to add the code.

  • Gloumi

    You save my life, thanks!

  • Sachin

    Thanks! This really helper!