ScriptReferenceBase.NotifyScriptLoaded 屬性

定義

警告

NotifyScriptLoaded is no longer required in script references.

取得或設定值,指出 ScriptResourceHandler 物件是否會自動在 ECMAScript (JavaScript) 檔案結尾加上程式碼,以呼叫 Sys.Application 類別的用戶端 NotifyScriptLoaded 方法。

public:
 property bool NotifyScriptLoaded { bool get(); void set(bool value); };
public bool NotifyScriptLoaded { get; set; }
[System.Obsolete("NotifyScriptLoaded is no longer required in script references.")]
public bool NotifyScriptLoaded { get; set; }
member this.NotifyScriptLoaded : bool with get, set
[<System.Obsolete("NotifyScriptLoaded is no longer required in script references.")>]
member this.NotifyScriptLoaded : bool with get, set
Public Property NotifyScriptLoaded As Boolean

屬性值

如果會在 JavaScript 檔案結尾自動呼叫 Sys.Application.notifyScriptLoaded 方法則為 true,如果使用者程式碼呼叫 JavaScript 檔案中現有的 Sys.Application.notifyScriptLoaded 方法則為 false。 預設值是 true

屬性

備註

NotifyScriptLoaded如果您參考元件中的腳本檔案,且腳本檔案已經包含呼叫Sys.Application.notifyScriptLoaded的程式碼,請將 屬性 false 設定為 。 如果從腳本檔案呼叫多個 Sys.Application.notifyScriptLoaded 方法,就會擲回錯誤。

如果您參考未內嵌在元件中的獨立腳本檔案,則必須在腳本檔結尾包含程式碼,才能呼叫 Sys.Application.notifyScriptLoaded 方法。 下列範例顯示腳本檔案結尾要包含的程式碼。

if(typeof(Sys) !== "undefined) Sys.Application.notifyScriptLoaded();  

適用於