admin管理员组

文章数量:1405392

I am looking for a way in IE to view the html source generated from jQuery code.
Ex.
HTML:

    <div id="myDiv"></div>

jquery:

    var wrapper = $("myDiv");
    var generated = $("<div>Hello world</div>");
    wrapper.append(generated);

I'd like to be able to examine and hopefully tweak the source generated by appending the generated element, not in Chrome or Firefox, but in IE 8 (where the problem is). I think that IE Developer Tools only shows the downloaded source, not what is generated.

Thanks.

I am looking for a way in IE to view the html source generated from jQuery code.
Ex.
HTML:

    <div id="myDiv"></div>

jquery:

    var wrapper = $("myDiv");
    var generated = $("<div>Hello world</div>");
    wrapper.append(generated);

I'd like to be able to examine and hopefully tweak the source generated by appending the generated element, not in Chrome or Firefox, but in IE 8 (where the problem is). I think that IE Developer Tools only shows the downloaded source, not what is generated.

Thanks.

Share Improve this question asked Nov 28, 2011 at 15:47 mkozickimkozicki 6,9021 gold badge19 silver badges17 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 5

Try going to the HTML tab in IE developer tools and press the refresh icon (next to the save icon), it will show the latest DOM.

Example:

Go to script tab and do:

document.body.appendChild( document.createElement("div") );

Then go to the HTML tab and hit the refresh icon and open the body tag, it should show the appended div now.

I remend Firebug Lite - http://getfirebug./firebuglite (it's Firebug for IE, sort of)

You should get Firebug Lite. You can check the code that jQuery does and much more.

Anyway, I remend that you put Google Chrome Frame patibility on your site, it will eliminate plenty of problems with your site (with the people that have Google Chrome Frame installed).

本文标签: jqueryHow to view javascript generated html for Internet ExplorerStack Overflow