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.
Here’s how I would go about setting up the functionality you’re looking for:
Or, if you don’t want to bump heads with just the one ‘value’ variable, create two variables to work in tandem:
Hope this helps.