Reputation: 31
I have a div that I'm trying to add html to. When I use a small html string it works, but when I try to add large html string nothing happens.
$("div") .html (data ) // about 1kB of html content
$("div" ) .html() // it return empty
If I do the same with a little html code like <p></p>
it works. Any suggestions?
I am using Internet Explorer 8, it works just fine in other browsers
Upvotes: 2
Views: 183
Reputation: 186762
data
defined? If so what is it? $('div').html('test')
populate the divs? If you get something like unterminated string literal
then you just need to escape the newlines with \
. You can also try making the variable and shorten it and see if jQuery fails at parsing it or not.
var longString = "\
<p>text</p>\
";
$('div').html(longString);
Upvotes: 2