【发布时间】:2013-06-27 14:28:09
【问题描述】:
我有一个包含 jQuery 的 iframe 内容,并且 iframe 中内容的 jQuery 部分在 IE 中不起作用(未使用 jQuery 的部分工作正常,在 Chrome 和 Firefox 中一切正常)。
代码如下:
<!DOCTYPE html>
<html>
<head>
<title>iframe content</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<h1>This heading is showing up just fine.</h1>
<div id="jQuery-generated-content">
<!-- content dynamically generated by jQuery plugin This part is not showing in iframe in IE -->
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"> </script>
<script src="pathTojQueryPlugin.js"></script>
<script type="text/javascript">
jQuery.codeToInitiatePlugin
</script>
</body>
</html>
我尝试在头部插入 jQuery 代码,就在 body 标记之后,包含相对路径和绝对路径,但没有成功。如果有人知道任何解决方法或导致 IE 无法读取 jQuery 的原因,我将不胜感激。
提前致谢!
【问题讨论】:
-
如果您正常加载页面而不是在 iframe 中加载,它是否有效?
-
这是 iframe 的代码吗?
-
是的,如果我正常加载页面就可以了,而不是iframe的内容。
标签: jquery internet-explorer iframe