?
This document uses PHP Chinese website manual Release
JScript? | 語言參考 |
返回或設(shè)置與特定錯誤相聯(lián)系的描述字符串。
object.description [= stringExpression]
description 屬性的語法組成部分如下:
object
必選項。Error 對象的任意實例。
stringExpression
可選項。包含錯誤描述的字符串表達(dá)式。
description 屬性包含與特定錯誤相聯(lián)系的錯誤信息字符串。使用包含在這個中的值,來警告用戶發(fā)生了一個不能或不想處理的錯誤。
下面的例子舉例說明了 description 屬性的使用:
try ???x = y???//
產(chǎn)生錯誤。catch(var e){???//
創(chuàng)建局部變量e
。 ???document.write(e)???//
打印"[object Error]".
???document.write((e.number & 0xFFFF))???//
打印5009.
???document.write(e.description)???//
打印"'y' is undefined".
}
版本5
number 屬性
應(yīng)用于: Error 對象