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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:09:36+00:00 2026-05-20T20:09:36+00:00

I have one function : jQuery(‘#’+’linkhere’).click(getHashPageClick); and in the function I am retreving window.location.hash

  • 0

I have one function :

jQuery('#'+'linkhere').click(getHashPageClick);

and in the function I am retreving window.location.hash value :

var getHashPageClick = function(evt) {
    var hashParam =  window.location.hash.substring(1);
}

But now I want to send a parameter to getHashPageClick(), say value , append hashParam value to it and access it in my calling function ? So something like this, maybe? :

jQuery('#'+'linkhere').click(getHashPageClick(value);
 alert("value");

and in the called function modify value of value :

    var getHashPageClick = function(evt,value) {
        var hashParam =  window.location.hash.substring(1);
        valuevalue+hashParam;
return value;

}

Would that be acceptable, or is there a different way to send a parameter by reference so that it is accessible in the calling function and modified value should be reflected ? Because this way doesn’t seem right to me. Any help would be appreciated. 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-05-20T20:09:37+00:00Added an answer on May 20, 2026 at 8:09 pm

    Here’s how I would go about setting up the functionality you’re looking for:

    jQuery(document).ready(function(){
         var value = 'some value';
         jQuery('#linkhere').click(function(){
              value = getHashPageClick(value);
              alert('the value is now: '+value);
         });
    });
    
    var getHashPageClick(value) {
            var hashParam =  window.location.hash.substring(1);
            value = value+hashParam;
            return value;
    }
    

    Or, if you don’t want to bump heads with just the one ‘value’ variable, create two variables to work in tandem:

    jQuery(document).ready(function(){
         var value = 'some value';
         jQuery('#linkhere').click(function(){
              hashValue = getHashPageClick(value);
              alert('the hash value is now: '+hashValue);
         });
    });
    
    var getHashPageClick(value) {
            var hashParam =  window.location.hash.substring(1);
            var hashValue = value+hashParam;
            return hashValue;
    }
    

    Hope this helps.

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

Sidebar

Related Questions

i have one function in jquery like this $(#Button_save).click(function() { Save Command; }); this
I have one variable value in my jQuery ready function, and I have one
Suppose I have created one jQuery function to check if elements exist or not
I have one page design with scrolling eased by jquery using this code: function
i have one jquery dialog which can show after click radiobutton. last time it
I have one function which return value in this format: li#2.ui-widget-content li#6.ui-widget-content li#12.ui-widget-content li#1.ui-widget-content
I have written one custom paremeterized jquery function for fadein and fade out. That
I have a function in jQuery jQuery(function () { jQuery(.one).showcase({ animation: { type: fade
I have multiple divs like setted up below. I want 1 (one) JQuery function
i have one jquery function which i need to work in following way 1.

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.