我有一個包含jQuery的iframe內容,並且iframe中的jQuery內容部分在IE中不工作(未使用的部分jQuery工作正常,並且一切正常Chrome和Firefox)。iframe中的jQuery不工作在IE中
下面的代碼:
<!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中加載頁面,它會工作嗎? – Barmar
這是iframe的代碼嗎? – raam86
是的,它工作,如果我正常加載頁面,而不是iframe的內容。 – hotate17