IE8在第4行抛出错误。
jQuery('#list script').each(function() {
var script=document.createElement('script');
script.type='text/javascript';
jQuery(script).text(jQuery(this).text()); //Error in IE8 does the field editing
document.body.appendChild(script);
}).remove();例程中的jquery错误:
append: function() {
return this.domManip(arguments, true, function( elem ) {
if ( this.nodeType === 1 ) {
this.appendChild( elem );
}
});发布于 2011-08-10 05:24:28
您不必重新创建脚本元素或执行所有显式删除操作。您可以简单地执行以下操作:
jQuery('#list script').appendTo('body');发布于 2011-08-10 05:22:27
如何更多地使用jquery ...
jQuery('#list script').each(function() {
jQuery('<script type="text/javascript" />').text(jQuery(this).text()).appendTo(jQuery('body'));
}).remove();发布于 2011-08-10 05:24:16
为什么不一直使用jquery呢?
jQuery('#list script').each(function() {
jQuery('<script></script>')
.attr('type','text/javascript')
.text(jQuery(this).text())
.appendTo(jQuery('body'));
}).remove();https://stackoverflow.com/questions/7003062
复制相似问题