jQax – A Simple jQuery Ajax Wrapper with Loading Notification
If you just want a simple way of connecting your web page to a .NET web ...
Upgraded by popular demand, the jQax ajax wrapper has been turned into a full fledged jQuery plugin, conforming to the plugin authoring guidelines and compatible with compression.
Below is the full code as of writing, if you’re interested in helping out, the source can also be found here on github
[gist id=534526 file=jquery.jqax.js]
Once you’ve referenced the script in the head section you can use the code like so:
var x = $.jQax({
LoaderContainerId: "#divMyLoadingDiv",
LoaderText: "I'm loading, wait up..."
});
Now you can perform the following function anywhere you need within scope of the above declaration:
var data = {
myTrackRecord: "52 Seconds",
activity: "go karts"
};
x.Post("MyWebService.asmx/Record", data, function (data, eventArgs) {
var result = $.parseJSON(data.d); // Please note: You may not need ".d"
// Do stuff here
});
The original non-plugin version of my code can be found in my previous post:
jQax – A Simple jQuery Ajax Wrapper with Loading Notification
Send me a message and I'll get back to you.