Call back function, variable scope?

M

Mark Smith

In the following code, should the variable e still be in scope on the
call back function, or could it be interpreted as null?

It seems to work in firefox, but IE gives the error "Member not found"


function showHelp(e,t)
{
$.get(
"showHelp.php",
{topic : t},
function(text) {
showTooltip(e,text);
}
);
}
 
H

Henry

In the following code, should the variable e still be in
scope on the call back function, or could it be interpreted
as null?

The outer function's formal parameter - e - will be in scope in the
inner function (visible on the scope chain for the call to the inner
function), and its value may be null.
It seems to work in firefox, but IE gives the error
"Member not found"
<snip>

In the absence of context and details the best you could expect is a
guess. My guess is that - e - is expected to refer to an event object
but the differences in the handling of event objects between IE and
firefox are not being appropriately handled by the code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top