Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8732181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:23:24+00:00 2026-06-13T09:23:24+00:00

I have a back button on a navigation bar at the top of the

  • 0

I have a back button on a navigation bar at the top of the page enabled with:

<div data-role="page" id="chat" data-add-back-btn="true">

I would like to call a javascript method when the back button is clicked, but without removing the back functionality. I was trying to create my own back button and then call to javascript:history.back(1) but I prefer to keep the original button.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T09:23:25+00:00Added an answer on June 13, 2026 at 9:23 am

    You cannot prioritize jQuery events, and jQuery events stack. So you have two options, one is to daisy chain your ordering of events (callbacks), the other is to remove the default behavior and overwrite the event.

    What you might want to do is event.preventDefault() followed by your code and then do a history.back(1):

    $(<backbutton selector>).click(function(event) {
      event.preventDefault();
      alert('this is a test');
      history.go(-1);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have multiple pages branching of a title page, and when a back button
I am having back button and edit button on my navigation bar like below
I have an application which used top bar navigation and a MapView. On the
I want to do something when I push back button of navigation bar. In
I have an iPhone application that's using Navigation Controller to display the top bar
I have overridden my back button method and I want to know, when at
I have a problem with the back button that is on my device in
I have open pdf file through my application.when click on device back button it
I have a scenario where my UINavigationController is missing the back button (left button)
I have an app that crashes if i press the home button, back button

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.