私はthis ASP.Net/jQuery session timeout controlを使用しています。素晴らしいですが、jQueryダイアログボックス以外の場所からjavascriptメソッドの1つにアクセスする必要があります。ここで私がアクセスしたいスニペットは次のとおりです。Javascriptメソッドの呼び出し方法(範囲外です)
TSC.Timeout.Timeout.prototype =
{
// THE METHOD I WANT TO CALL: _resetTimeout()
_resetTimeout: function (e) {
// modify timeout to do jquery dialog
if (typeof jQuery.ui == 'undefined')
$get(this._clientId).style.display = 'none';
clearTimeout(this._timerAboutToTimeout);
clearTimeout(this._timerTimeout);
clearTimeout(this._timerCountDown);
this._showAboutToTimeoutDelegate = Function.createDelegate(this, this.showAboutToTimeout);
this._timerAboutToTimeout = setTimeout(this._showAboutToTimeoutDelegate, this._aboutToTimeoutMinutes * 5 * 1000); //TODO: Change this back to 60
this._timeoutDelegate = Function.createDelegate(this, this.timeout);
this._timerTimeout = setTimeout(this._timeoutDelegate, this._timeoutMinutes * 10 * 1000); //TODO: Change this back to 60
},
// HOW IT'S BEING CALLED FROM WITHIN THE JS OBJECT:
initDialog: function (e) {
// modify timeout to do jquery dialog
if (typeof jQuery.ui != 'undefined') {
var tsc = this;
$("#" + this._clientId).dialog({
autoOpen: false,
width: 500,
resizeable: false,
bgiframe: true,
modal: true,
position: 'center',
buttons: {
"Keep Me Signed In": function() {
$(this).dialog('close');
CallServer();
tsc._resetTimeout();
}
}
});
}
}
}
私は_resetTimeout()
は、コンソールから仕事を得るように見えることはできません。私はそのメソッドを呼び出すことができますどのように
Uncaught TypeError: Cannot read property 'length' of undefined
TSC.Timeout.Timeout.showAboutToTimeoutWebResource.axd:200
(anonymous function)ScriptResource.axd:47
WebResource.axd:217Uncaught TypeError: Cannot read property 'length' of undefined
TSC.Timeout.Timeout.timeoutWebResource.axd:217
(anonymous function)ScriptResource.axd:47
WebResource.axd:213Uncaught TypeError: Property 'focus' of object [object DOMWindow] is not a function
TSC.Timeout.Timeout.showAboutToTimeoutWebResource.axd:213
(anonymous function)
任意のアイデア:TSC.Timeout.Timeout.prototype._resetTimeout();
を呼び出すと、次のエラーを生成しますか?