Skip to content

Instantly share code, notes, and snippets.

Created February 13, 2012 05:21
Show Gist options
  • Save anonymous/1813906 to your computer and use it in GitHub Desktop.
Save anonymous/1813906 to your computer and use it in GitHub Desktop.
TheAbacus - pastebin.com/qY1e6sjm
// JavaScript Document
function Temp() {
var test = "testing";
}
Temp.prototype.init = function() {
$.ajax({ //IE errors here.
url: "xd_subnav.xml",
dataType: "xml",
success: function(xml) {
alert(this.test);
}.bind(this) //The "bind" here is what I believe is the problem. However, without it, how do I access the variable test?
});
}
a = new Temp();
a.init();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment