Am try to pass a variable (myVar) by reference into a
click function. How do I get the correct value of myVar
outside the click function. Thanks. Greg
Here is my code:
var data = {myVar:0};
$('a[href*="'+matchStr+'"]').click (data,function (e) {
if ($.cookie ('IDXplosionPOP_click_count') == null) {
$.cookie ('IDXplosionPOP_click_count', 1, { path: '/',
expires: 180, domain: cookieDomain });
e.data.myVar = 1;
}
else {
var num = Number ($.cookie ('IDXplosionPOP_click_count'));
$.cookie ('IDXplosionPOP_click_count', num + 1, { path:
'/', expires: 180, domain: cookieDomain });
e.data.myVar = num+1;
}
});
console.log (data.myVar); // always displays 0
--
Greg Turner, M.A.
https://www.ZenOfW...
[masked]