简体   繁体   中英

To set html content using html.innerHTML,so that it works in IE 8 and 9

var body = dojo.create("html", {innerHTML: tmplStr}).children[1];

tmplStr is giving the needed html content. I want to set it to html.innerHTML. Above code works fine in FireFox,GoogleChrome and IE10. But not working in IE8 and 9.Since innerHTML is read only in IE8 and 9, I'm not able to set the content in IE8 and 9. Please it would great if someone helps me in fixing this issue.

var body = dojo.create("html");
html.set(body, tmplStr).children[1];

the above 2 lines will resolve the isssue. It works absolutely fine IE8,9,10, Google chrome and ff

Have you tried using jQuery?
Doing: $('your_selector').text(yourHTMLCode);

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