我有一些使用jQuery.clone()来获取页面的html,然后将其添加到pre标签.它在Firefox和Chrome中正常运行,但在IE中没有任何反应:
<!DOCTYPE html> <html> <head> <script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <Meta charset=utf-8 /> <title>JS Bin</title> <!--[if IE]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <script> $(function(){ $('button').click(function(){ var $clone = $('html').clone(); $('#output').text($clone.html()); }); }); </script> <style> article,aside,figure,footer,header,hgroup,menu,nav,section { display: block; } </style> </head> <body> <button>run test</button> <pre id="output"></pre> </body> </html>
有没有知道IE的错误阻止这个,或者我做错了什么?
(我需要克隆它,因为我在输出之前对它进行了一些更改)
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。