2011-06-06 67 views
1

對於某些URL(例如http://www.nyest.hu/iframe/240/10),IE8(及更早版本)從未停止加載,但出現以下錯誤消息:SCRIPT123: This command is not supported.錯誤行號指向document.write命令。 IE9和其他瀏覽器加載頁面沒有問題。IE8在document.write上掛起,並且「不支持該命令」

+0

不確定這一點,但我相信有一些doctypes不支持document.write。什麼doctype是頁面?你有沒有嘗試過使用不同的文檔類型? (HTML代替XHTML) – GordonM 2011-06-06 06:00:50

+0

@GordonM:類似的東西,但它是導致問題的MIME類型('application/xhtml + xml'),而不是doctype(過渡XHTML)。該頁面不在我的控制之下。 – Tgr 2011-06-06 06:39:28

回答

1

顯然這是因爲該頁面以XML形式提供,並且there is no document.write in an XML document。其他瀏覽器也會在document.write命令中引發某種錯誤,但它們會更好地處理錯誤,並完成加載頁面。

+1

請參閱[Mozilla web開發人員常見問題](https://developer.mozilla.org/en/Mozilla_Web_Developer_FAQ#How_is_the_treatment_of_application.2fxhtml.2bxml_documents_different_from_the_treatment_of_text.2fhtml_documents.3f)。 – Keith 2011-06-06 06:05:55