誰か助けてください。
以下のようなiframeを作成するJS(以下のtarget.js)を作成しました。
原因はわかりませんが、IE9,8でオンロード機能が動作しません。
script タグを削除すると、onload 関数が機能し、ウィンドウがスクロールして固定されました。
<body onload="location.hash='#hashparam';">
HTML
<!-- Target part -->
<script params="parameters" src="target.js"></script>
<iframe src="target.html?parameters">
<html>
<head>
</head>
<body>
<script src="target-inner.js"></script>
many iframes which are made by the script tags
</body>
</html>
HTML
</body>
誰かが原因を知っていますか?ご存知でしたらご教授願います。
// target-inner.js
isIE = /MSIE/.test(window.navigator.userAgent);
isIE10 = /MSIE 10/.text(window.navigator.userAgent);
if (isIE10 || !isIE) {
doc.clear();
doc.open;
}
doc.write("<html><head></head><body>");
doc.write(text);
doc.write("</body></html>");
if (isIE10 || !isIE) {
return doc.close();
} else {
return;
}