JSFiddle - React, Tailwind, and code Playground
by stefanpetre
JavaScript
var compl = function() {
alert(this);
if (this.url) {
alert('It has the property \'url\' of value '+ this.url);
testContext(1);
} else {
alert('+ 1 = ' + (this+1) );
}
}
var testContext = function(cntxt) {
alert('Context is ' + cntxt);
$.ajax({
data: {test:'test'},
type: 'get',
url: '/',
complete: compl ,
context: cntxt
})
}
testContext(0);