I feel ackward asking these fundamental questions given that I am not exactly new to web development. But I want to double-check my assumptions nevertheless...
I'm building the recording of unique image views in my application. When a user (not a bot) visits an image page, an Ajax call is made to a back-end process that collects the session info, compares for duplications and stores the visit. I have all my javascript references as well as this call at the bottom of the HTML, just before the </body>
element:
$.get(basepath + "image/1329/record/human", function(data){
console.log("Data Loaded: " + data);
});
By default, the call to $.get is made asynchronous. Yet I want to test the following assumptions:
According to jQuery .get reference...
This [$.get()] is a shorthand Ajax function, which is equivalent to:
$.ajax({ url: url, data: data,
success: success, dataType: dataType
});
And $.ajax is asynchronous (i.e. non-blocking) by default, that's what the A in Ajax means.
Also, back-end server code is started in the moment the server receives the request and then runs independently of the client staying on the page or not, unless you implement some kind of mechanism to stop the running service which I suppose you did not.
God bless!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With