Are AJAX non-blocking and what is their lifespan?

I feel aloof from these fundamental questions, given that I'm not completely new to web development. But I want, nevertheless, to check my assumptions ...

I am creating a unique image record in my application. When the user (not the bot) visits the image page, an Ajax call is made to the internal process, which collects session information, compares duplicates, and saves the visit. I have all my javascript links, as well as this call at the bottom of the HTML, immediately before the element </body>:

$.get(basepath + "image/1329/record/human", function(data){
console.log("Data Loaded: " + data);
});

By default, the call to $ .get is asynchronous. However, I want to verify the following assumptions:

  • Is it correct that this method ensures that the invocation of a script view entry is not blocked for the rest of the user interface?
  • Is it right that the back-end script completes once, regardless of whether the user goes to another page?
+5
source share
3 answers

According to jQuery.get link ...

This [$ .get ()] is an abbreviated Ajax function, which is equivalent to:

$.ajax({ url: url,   data: data,  
         success: success,   dataType: dataType
});

And $ .ajax is by default asynchronous (i.e. non-blocking), which means A in Ajax.

, , , , , , - , , , , .

!

+5

jQuery.get, , DOM JavaScript. get - , jQuery.ajax.

, , , , , / .

API:

+4

+2

All Articles