Skip to content Skip to sidebar Skip to footer

Is It Normal To Have A Short Delay After .innerhtml = Xmlhttp.responsetext;?

Is it normal to have a short delay after .innerHTML = xmlhttp.responseText; ? Delay aproxamilty 1 sec. after xmlhttp.readyState==4. Using firefox 3.0.10

Solution 1:

No, this sounds like you may have some malformed or large response.

The browser will parse the responsetext and construct nodes in the DOM. This is typically very fast in Firefox.

Perhaps you could describe your circumstances and response text a little more and it would help us debug.

Solution 2:

Do you have firebug installed? If not, install that from here (https://addons.mozilla.org/en-US/firefox/addon/1843) and enable the console and script and then you'll be able to see when the responseText is returned. But generally, yes its normal to have a short delay while the request is being made.

Solution 3:

how are you doing the timing to verify the difference? (console dump?)

Some delay is unavoidable as innerHTML (or DOM manipulation, for that matter, as well) requires the browser to interpret and process and display the changes. Certainly, depending on the size of the change, this could take 1 sec.

Solution 4:

usually i don't see that behavior. you can put some sample code here, or try

http://www.0011.com/ajax_example

and see if you see the same behavior as your code.

Post a Comment for "Is It Normal To Have A Short Delay After .innerhtml = Xmlhttp.responsetext;?"