views:

71

answers:

4

I've been having this problem in the Chrome browser.

i use jquery's ajax post. Ajax is supposed to return a really long raw html.

When I do it in FF3 and IE8 it works fine. But in chrome the data seems to be truncated.

+1  A: 

As of what i know, there is limit of 4kb. However this is also browser-dependent.

Sarfraz
4kb would seem awfully small.
Toad
yes it is i suppose.
Sarfraz
A: 

It may also run into server-side size limits as well as client or server side time-out limits. Depending on the platforms and browsers these limits can be quite different for ajax requests than they are for standard browser requests too.

I would recommend that you use an iframe to contain the HTML, and use ajax to control the iframe's source. When you need to load the HTML, just have javascript point the iframe at a URL that will produce that HTML. This way you are only limited by the regular HTML request timeout and size limits, not the (sometimes) more restrictive ajax limits.

Stephen M. Redd
+1  A: 

Hi,

I do not have many details about the raw HTML, but I would like to share what I found to be true in the applications I worked on:

  1. There is no limit to the amount of data you receive via AJAX request
  2. However, if the amount of data being requested is very long it can time-out
  3. If you are calling an entire HTML page, and it has script tags in the header, this can cause problems if you try to set it inside a div on the page itself. If this is the case, then set the script tags inside the body tag and it will work.

If this is not helpful, please feel free to provide a little more information about the raw HTML

Kartik Sehgal
A: 

Where are you seeing the truncated response? Could it be that Chrome is trying to parse the html as xml (since it's from an xhr) and failing?

ss ulrey