i trying async page open inside div $.ajax still having 3sec delay after clicking link , time page jammed. happens @ least chrome , sasfari. going wrong way..?
$.ajaxsetup({ async: true }); $(document).ready(function() { $("#button").click(function(evt) { $('#change').html('<p><img src="ajax-loader.gif" width="15" height="15" /></p>'); $.ajax({ url: "reg.php", cache: false }).done(function( html ) { $("#change").html(html); }); }); });
no, asynchronous ajax requests don't hold browser. problem elsewhere, in code haven't shown. code you've shown correctly async request.
speculating on possible issues can't see:
if link has
href
, you're not cancelling default action, loading page. can prevent default callingevt.preventdefault()
within click handler, or doingreturn false;
@ end of (which , stops propagation).if have other code elsewhere setting
async: false
default, perhapsajaxsetup
changing isn't getting called.
Comments
Post a Comment