Skip to content

Instantly share code, notes, and snippets.

@mg
Created November 27, 2013 12:44
Show Gist options
  • Save mg/7675067 to your computer and use it in GitHub Desktop.
Save mg/7675067 to your computer and use it in GitHub Desktop.
(function($) {
window.LI = $.extend(window.LI || {}, {exec: function(m, a, s, e) {
jQuery.when(jQuery.ajax({type: 'POST',url: '/Services/MethodProxy.asmx/Execute',data: '{"methodName":"' + m + '","args":' + (a.toJSON ? a.toJSON() : JSON.stringify(a)) + '}',contentType: 'application/json;charset=ISO-8859-1',dataType: 'json')
.then(
function(r) { s(r.d); },
function(r) {
if (r.responseText == '')
return;
var x = JSON.parse(r.responseText);
if (x.Stacktrace) {
console.log(x.Stacktrace);
}
if (x.Timeout) {
location.reload(true);
} else {
if (e) {
e(x.Message, a);
} else if (webFramework && webFramework.displayError) {
webFramework.displayError(x.Message);
}
}
}
);
});
},TabsControlLoader: {LoadControl: function(p0, p1, p2, s, e) {
return LI.exec('TabsControlLoader.LoadControl', [p0, p1, p2], s, e);
}}});
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment