如何在JavaScript中识别Sys.UI.\u计时器?
在我的网页源代码中,我有:如何在JavaScript中识别Sys.UI.\u计时器?,javascript,jquery,asp.net,.net,Javascript,Jquery,Asp.net,.net,在我的网页源代码中,我有: Sys.Application.add_init(function() { $create(Sys.UI._Timer, {"enabled":true,"interval":300000,"uniqueID":"timerMain"}, null, null, $get("timerMain")); }); 什么是Sys.UI.\u计时器?它是服务器端的.Net类吗?Sys.UI.\u Timer是一个类似于服务器控件但在客户端运行的类(使用JS),该类使
Sys.Application.add_init(function() {
$create(Sys.UI._Timer, {"enabled":true,"interval":300000,"uniqueID":"timerMain"}, null, null, $get("timerMain"));
});
什么是Sys.UI.\u计时器?它是服务器端的.Net类吗?
Sys.UI.\u Timer
是一个类似于服务器控件但在客户端运行的类(使用JS),该类使用AJAX客户端库创建计时器控件。该类的默认构造函数定义如下所示:
Sys.UI._Timer = function Sys$UI$_Timer(element) {
Sys.UI._Timer.initializeBase(this,[element]);
this._interval = 60000; // Interval property, measured in milliseconds
this._enabled = true; // Enabled property
this._uniqueID = null; // UniqueID property
// client-side only properties
this._postbackPending = false;
this._raiseTickDelegate = null;
this._endRequestHandlerDelegate = null;
this._timer = null;
this._pageRequestManager = null;
}
注意,这是静态方法的简写,它创建(并初始化)一个具有指定类型作为参数的组件(在本例中为Sys.UI.\u Timer
)。要设置为组件属性的属性值必须以JSON格式提供,并且属性名称的用法不带下划线(因此\u interval
变成了interval
),使用以下语法:
$create(type, { "propertyName": value, ... }, events, references, $get(elementName));
进一步阅读:
您需要添加更多信息。我猜您使用的是.Net framework,那么您应该包含.Net标记,以便开发人员可以看到。这个框架之外的人不会知道。