Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

狀況

假設您定義 maxLength 屬性,定義網頁上值的文字區域項目。然後,您會在 Internet Explorer 11] 中的舊版的缺點模式中開啟網頁。當您嘗試在網頁上使用 getAttribute 方法來擷取 maxLength 屬性時,則結果會是 null。

解決方案

更新資訊

若要解決這個問題,請安裝最新的 Internet Explorer 累積安全性更新。要執行這項操作,請移至Microsoft Update此外,請參閱技術資訊,瞭解有關 Internet Explorer 最新的累積安全性更新

注意此更新已先併入年 3 月的 Internet Explorer (MS15-018) 的累積安全性更新

因應措施

若要解決這個問題,您可以設定為使用較新的文件模式的網頁。

其他資訊

這個問題是因為如果網頁使用 Internet Explorer 5 文件模式 (缺點模式) 或 Internet Explorer 7 的文件模式未 maxLength 屬性公開至文件。網頁發生問題的範例如下︰

<html><head>
<meta content="IE=5" http-equiv="X-UA-Compatible" />
</head>
<body>
<textarea rows="4" cols="50" maxLength="200" onclick="javascript:alert ('maxLength is ' + this.getAttribute('maxLength'));"></textarea>
</body>
</html>

狀態

Microsoft 已確認這是<套用>一節所列出的 Microsoft 產品的問題。

參考

請參閱 Microsoft 會使用來描述軟體更新術語

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。

Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×