[英]JavaScript error anonymous function
I have something like this 我有这样的东西
if(window.Test==null)
{
window.Test = {};
Test.usrTZ = Test.getTZ( new Date().getTimezoneOffset() );
Test.getTZ = function(offset)
{
.....
return offset;
};
}
The line Test.usrTZ = Test.getTZ( new Date().getTimezoneOffset() );
行Test.usrTZ = Test.getTZ( new Date().getTimezoneOffset() );
throws in Chrome an error "Uncaught TypeError: undefined is not a function"
. 在Chrome中抛出错误"Uncaught TypeError: undefined is not a function"
。 I in general use traditional object notation, but want to learn how to use this one. 我通常使用传统的对象表示法,但想学习如何使用这一表示法。 I'm not sure what I'm doing wrong here - any help is much appreciated! 我不确定自己在做什么错-非常感谢您的帮助!
在定义之前,您正在调用Test.getTZ
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.