これは頭を悩ませ、一日中追いかけています。サイトでスクリプトを呼び出してコードを挿入する広告サーバーがあります。
たとえば、iframe で呼び出される Adserver ページ:
<html>
<head><title></title></head>
<body>
<script src="http://adserver/ad?s=728x90"></script>
</body>
</html>
上記のスクリプト呼び出しによって返される JavaScript:
document.write('<script type=\'text/javascript\' src=\'http://partner.googleadservices.com/gampad/google_service.js\'>\n');
document.write('</script>\n');
document.write('<script type=\'text/javascript\'>\n');
document.write('GS_googleAddAdSenseService("ca-pub-xxxxxxxxxxxxxxxxxxx");\n');
document.write('GS_googleEnableAllServices();\n');
document.write('</script>\n');
document.write('<script type=\'text/javascript\'>\n');
document.write('GA_googleUseIframeRendering();\n');
document.write('</script>\n');
document.write('\n');
document.write('<script type=\'text/javascript\'>\n');
document.write('GA_googleFillSlotWithSize("ca-pub-xxxxxxxxxxxxxxxxxx", "Global_728x90", 728, 90);\n');
document.write('</script>\n');
これにより、Google Ad Manager 広告がページに挿入されます。問題は、コードが IE 7 および 8 では機能しないことですが、Chrome、Firefox、Safari などでは正常に機能します。
IE によって返される「エラー」は「Object Expected」であり、IE の「Developer tools」で実行しても役に立ちません。
私はそれを機能させるためにたくさんのことを試しました。
GS_ または GA_ 関数が実行されるたびにエラーが発生しているように見えるので、IE が外部スクリプトによるページへの書き込みを停止しようとしていると思われますか?
エラーが発生している理由や解決策を誰かが明らかにすることはできますか?
ありがとう