0
如何從表單事件中調用名稱空間中的函數? 我試圖在命名空間中調用JavaScript函數的表單事件
accountLib.accountType.showType
和
accountLib.accountType.showType()
在onload事件
,但它不工作。
這是代碼:
/// <reference path="Scripts/XrmPageTemplate.js" />
if (typeof (accountLib) == "undefined") {
accountLib == {}; // namespace
}
accountLib.accountType = {
showType: function() {
alert("RINNING");
}
};
順便說你的第二個例子:「accountLib.accountType.showType()」應該能正常運行。 – Mattyod 2013-02-26 13:31:33
謝謝!我沒有注意到比較運營商。 accountLib.accountType.showType的作品;表單事件不喜歡()函數。奇怪的是,我沒有得到有關accoutLib在你的幫助之前不存在的任何錯誤。 – Bvrce 2013-02-26 13:43:38