简体   繁体   中英

jQuery and IE8: top part of HTML text cut-off when using element.append()

I am appending a large amount of HTML (~60k) to an element. My code looks like this:

currentElement.html(response);

This works fine in Chrome and modern IE but strangely the top part of the HTML gets removed during the .html() operation. Ie, the element isn't blank but is filled with the lower 2/3 or so of the response html.

I've debugged this through jQuery and verified that jquery is using .empty().append() to add the html.

jQuery versioN: 1.10.1 (Got to use this unless there's a known bug.)

Any ideas?

The issue in my case was that the HTML being loaded had an onclick="window.open(...)" command in it. All HTML after it was truncated - no doubt for security reasons - and anything after that section was retained.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM