Fork me on GitHub

Javascript Arguments Callee Caller

    function progress() {
        var value = $('#p').progressbar('getValue');
        if (value < 100) {
            value += Math.floor(Math.random() * 10);
            $('#p').progressbar('setValue', value);
            var invoker = arguments.callee.caller || null;
            if (invoker != null) {
                alert(invoker);
            }
            setTimeout(arguments.callee, 200);
        }
    }

    function invoker() {
        progress()
    }

    invoker();

 

posted @ 2012-11-23 14:44  Nick.Chung  阅读(209)  评论(0编辑  收藏  举报