i have this in my document ready function
<script type="text/javascript">
$(document).ready(function () {
if ($("[rel=tooltip]").length) $('[rel=tooltip]').tooltip();
var path = "@Url.Content("~/Contents/Users/" + HttpContext.Current.User.Identity.Name + "/images/")";
$.vegas({
src: path + Preferences.GetBackground(),
fade: 2000
})@*('overlay', {
src: "@Url.Content("~/Contents/css/images/01.png")"
})*@;
});
</script>
I’m using the plugin vegas for the full screen background image in the website. so $.vegas actually sends a GET request to the server. my question is, does this cause the browser to wait for the response and then only show the contents to the user or is it done behind the scene while the contents are displayed?
I was asking this because the background image is often more than 150kb,so i wanted to make sure this doesnt increase the response time.
If the vegas plugin is using
$.ajaxto make the request using a standard configuration (i.e.asyncistrue) then the page will not be waiting on the request to complete as the operation is asynchronous. Usually, a callback function is passed when an AJAX request is made, to be executed when the response is returned.If
asyncis set tofalsehowever, then the page will be waiting for the repsonse to come back.