簡體   English   中英

JavaScript錯誤匿名函數

[英]JavaScript error anonymous function

我有這樣的東西

if(window.Test==null)
{
    window.Test = {};
    Test.usrTZ = Test.getTZ( new Date().getTimezoneOffset() );

    Test.getTZ = function(offset)
    {
     .....
     return offset;
    };

}

Test.usrTZ = Test.getTZ( new Date().getTimezoneOffset() ); 在Chrome中拋出錯誤"Uncaught TypeError: undefined is not a function" 我通常使用傳統的對象表示法,但想學習如何使用這一表示法。 我不確定自己在做什么錯-非常感謝您的幫助!

在定義之前,您正在調用Test.getTZ

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM