Category Archives: AJAX

Difference Between Constant and ReadOnly

Here I will explain the difference between Constant, ReadOnly and Static with example or can we marked it as static or not or how to declare it and where we can change their values with example. Const Keyword 1) A const filed must be initialized or assigned a value at the time of variable declaration and… Read More »

Abort Ajax requests using jQuery

Most of the jQuery Ajax methods return an XMLHttpRequest (or the equivalent) object, so you can just use abort(). Example: var xhr = $.ajax({ type: “POST”, url: “some.php”, data: “name=John&location=Boston”, success: function(msg){ alert( “Data Saved: ” + msg ); } }); //kill the request xhr.abort() As of jQuery 1.5 the returned object is a wrapper… Read More »

JSON in AJAX

JSON stands for JavaScript Object Notation. It is easy to understand and data exchange is fast than XML. It supports array

Important methods of XMLHttpRequest

abort()Cancels the current request. getAllResponseHeaders()Returns the complete set of HTTP headers as a string. getResponseHeader( headerName )Returns the value of the specified HTTP header. open( method, URL )open( method, URL, async ) open( method, URL, async, userName ) open( method, URL, async, userName, password ) Specifies the method, URL, and other optional attributes of a… Read More »

What is difference between jQuery.get() and jQuery.ajax() method?

$.ajax() is the most configurable one, where you get fine grained control over HTTP headers and such. You’re also able to get direct access to the XHR-object using this method. Slightly more fine-grained error-handling is also provided. Can therefore be more complicated and often unecessary, but sometimes very useful. You have to deal with the… Read More »