我在我的web應用程序Timer1和enabled = false
上有一個計時器。我想用jquery來啓動我的計時器。我認爲$("Timer1").enableSelection('True');
會工作,但它似乎沒有工作。使用jquery觸發我的計時器
此處有任何建議嗎?
謝謝你們!
我的jQuery代碼:
var lastupdate;
$(function() {
$.ajaxSetup({
type: "POST",
contentType: "application/json; charset=utf-8",
dataType: "json",
data: "{}",
error: function (a, b, c) {
try {
var err = (JSON.parse(a.responseText)).Message;
alert(err);
}
catch (ero) {
alert(a.responseText);
}
}
});
// updateSettings();
$("#refreshBaan").click(function() {
$.ajax({
url: "Default.aspx/refreshBaan",
success: function (msg) {
$("#lastBaanUpdate").html("");
$("#lastBaanUpdate").progressbar({ value: 0 });
$("#refreshBaan").attr("disabled", "disabled");
//**
$(function() {
$("Timer1").enableSelection('True');
$("#progressbar").progressbar({ value: 0 });
setTimeout(updateProgress, 200);
});
function updateProgress() {
var progress;
progress = $("#progressbar")
.progressbar("option", "value");
if (progress < 100) {
$("#progressbar")
.progressbar("option", "value", progress + 2);
setTimeout(updateProgress, 200);
}
}`
我的C#:
<asp:Timer ID="Timer1" runat="server" Interval="17000" ontick="Timer1_Tick" Enabled="False" />
您可以更新您的問題提供多一點,你正在使用的代碼?不知道你在哪裏,很難提供幫助。 – McHerbie 2011-02-28 19:57:58
我冒昧地「提高」你的問題,使其更具描述性和良好格式化。我@McHerbie同意,因爲它是的,問題是太模糊了,請給多一點背景下,將幫助我們來幫助你。 – Trufa 2011-02-28 20:00:24
感謝分享代碼也請儘量正確地格式化,同時如果你覺得這可能是realted到C#或ASP請大家重新標記你的問題的時候(沒做我自己監守我不知道它是否適用) – Trufa 2011-02-28 20:03:32