How to acces a global variable in a callback object in javascript YUI without use window.myvariable

Posted by quilovnic on Stack Overflow See other posts from Stack Overflow or by quilovnic
Published on 2010-05-01T10:35:28Z Indexed on 2010/05/01 10:37 UTC
Read the original article Hit count: 226

Filed under:
|

I have this :

var MyObject = function(){ this.url = "monurl"; this.mavar = ""; this.Load = function(){ var callback = { success: function(o){ mavar = o.responseXML.getElementsByTagName("montag")[0].firstChild.nodeValue; } } YAHOO.util.Connect.asyncRequest('GET',url,callback); } }

the mavar variable is not accessible. How can I do this ?

© Stack Overflow or respective owner

Related posts about yui

Related posts about JavaScript