Blabla Blabla - 1 year ago 67
jQuery Question

Get result of function used in .on

I have function, lets name it

, which returns variable Y. This function is used in action
.on("focusout", X1)
. How I can get variable
? The result of
when after executing

Answer Source

You could change the scope of Y to sit outside the scope of the function X1

var Y = 0;
var X1 = function () { Y++; };


function doCheck() {
   if (Y == 1) {
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download