Error while using exit(0) in javascript - Stack Overflow

var inDoubleTap = false;Shared across all bound elementsreturn $list.live('touchstart',

var inDoubleTap = false; // Shared across all bound elements
return $list.live('touchstart', function(e) {
    if (e.originalEvent.touches.length === 1) {
        if (!inDoubleTap) {
            inDoubleTap = true;
            setTimeout(function() { inDoubleTap = false }, delay);
        } else {
            inDoubleTap = false;
            callback.call(this, e);
            exit(0);
        }
    }
});

The above code shows an error if i use exit(0) in mobile browsers (iphone, ipad)

var inDoubleTap = false; // Shared across all bound elements
return $list.live('touchstart', function(e) {
    if (e.originalEvent.touches.length === 1) {
        if (!inDoubleTap) {
            inDoubleTap = true;
            setTimeout(function() { inDoubleTap = false }, delay);
        } else {
            inDoubleTap = false;
            callback.call(this, e);
            exit(0);
        }
    }
});

The above code shows an error if i use exit(0) in mobile browsers (iphone, ipad)

Share Improve this question edited May 19, 2011 at 8:56 Félix Saparelli 8,7496 gold badges55 silver badges68 bronze badges asked May 19, 2011 at 8:49 TarunTarun 132 silver badges9 bronze badges 2
  • 5 Under no circumstance tell us what error you're getting exactly - it would spoil the fun of guessing! – Pekka Commented May 19, 2011 at 8:51
  • 3 What did you expect exit(0) to do? Close the browser? Seriously, I'd like to understand your reasoning. – Zecc Commented May 19, 2011 at 8:56
Add a ment  | 

1 Answer 1

Reset to default 4

Surely you mean return; instead of exit(0). That should work.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745501844a4630452.html

相关推荐

  • Error while using exit(0) in javascript - Stack Overflow

    var inDoubleTap = false;Shared across all bound elementsreturn $list.live('touchstart',

    3小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信