$("a").live("click", function(e) {
e.preventDefault();
setTimeout(function() {
$.get(
"someOtherUrl",
{someVariable: "someValue"},
function(result) {
$(".result").html(render(result));
}
);
}, 1000);
$('a').live("touchmove", function(e) {clearTimeout()});
});
我希望當用戶移動他的手指在屏幕上以停止超時。事情是,clearTimeout()不起作用,因爲它沒有鏈接到超時。我將如何命名超時並快速清除? 我使用正確的方法嗎?