i have eval function, which needs to execute javascript from php. but i need to pass element, so i can put mouse over tips on the link user clicked on.
var globalEval = function globalEval(src, element) {
if (window.execScript) {
window.execScript(src);
return;
}
var fn = function(element) {
window.eval.call(window,src);
};
fn(element);
};
im using following way to pass $(this)
element
globalEval(js_code, $(this));
// js_code is = alert(element);
i get error of undefined element, which is defined in globalEval();
how can i fix this?