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 7875821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:03:56+00:00 2026-06-03T03:03:56+00:00

I want to create a button which will run a previously ran function. ie

  • 0

I want to create a button which will run a previously ran function. ie i click buttonA to run Function A then click button B to run functionB i want to have a button which allows the user to go back to functionA by clicking a back button.

i thought i could a global variable to hold previous statements but it would not work as every function ran would overwrite the stored statements. here is some psuodo code to kind of explain what i mean

var globalvar;
globalvar = functionA;
function B { run globalvar};
  • 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-03T03:03:57+00:00Added an answer on June 3, 2026 at 3:03 am

    Use hash hyperlinks and the hashchange event. In jQuery:

    $(window).on('hashchange',function() {
        var hash = location.hash.substring(1); // strip the leading # symbol
        // now run code based on whatever the value of 'hash' is
    });
    

    HTML:

    <a href="#hash1">function A</a>
    <a href="#hash2">function B</a>
    

    Now, whenever the user clicks the browser’s “back” button (or an HTML button that triggers history.go(-1)), it will go back to whatever hash was previously selected and trigger the hashchange event again.

    http://jsfiddle.net/mblase75/hL5FZ/

    Warning: older browsers like IE7 may not support hashchange or history.go().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a service which will run on a separate thread (not
I have a toolbar and want to create a button that will display a
For a project we want to create a button which will make a tiny
i want to create a button which works like a real back button.When i
I want to create a dialog which appears when user presses a button. (In
I want to create JSF table which has select all button and check box
I have created a button which I want to expand/contract. I found a way
I want to create a button that has a jQuery click on the fly.
i want to create such application in android which will be activated when i
I have a scenario where i want : To create a data class which

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.