JavaScript在IE中不工作?
所以,我从网上偷了剧本。基本上,它应该调整iframe的大小以适应其内容JavaScript在IE中不工作?,javascript,jquery,iframe,Javascript,Jquery,Iframe,所以,我从网上偷了剧本。基本上,它应该调整iframe的大小以适应其内容 function sizeIFrame() { var helpFrame = jQuery("#elastic"); var innerDoc = (helpFrame.get(0).contentDocument) ? helpFrame.get(0).contentDocument : helpFrame.get(0).contentWindow.document; helpFrame.hei
function sizeIFrame()
{
var helpFrame = jQuery("#elastic");
var innerDoc = (helpFrame.get(0).contentDocument) ? helpFrame.get(0).contentDocument : helpFrame.get(0).contentWindow.document;
helpFrame.height(innerDoc.body.scrollHeight + 35);
}
不过,它在Internet Explorer中似乎不起作用!iframe源在同一台服务器上,因此这不应该是问题所在。知道怎么了吗?iframe ID是弹性的。我已经在Firefox、Chrome和Safari中测试过了,这三种浏览器都能正常工作
编辑 我决定用另一个更强大的jQuery解决方案替换脚本。虽然它不像我希望的那么轻,但它似乎很管用
请参阅:我只需用这个更大的jQuery解决方案替换我的解决方案,就可以让它正常工作。虽然更大,但它像一个魅力