Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/474.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
JavaScript在IE中不工作?_Javascript_Jquery_Iframe - Fatal编程技术网

JavaScript在IE中不工作?

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

所以,我从网上偷了剧本。基本上,它应该调整iframe的大小以适应其内容

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解决方案替换我的解决方案,就可以让它正常工作。虽然更大,但它像一个魅力