阅读背景:

如何在使用AJAX时控制JavaScript函数的顺序

来源:互联网 

My Setup

function ajaxLoadSth(value, attribute) {

    $.post( url, value, function(response) {

        // interpreting the response
        var foobar = $('#foo') + $('.bar').find('.sth');

        // print interpretation into DOM
        container.append(foobar);

        // do some funky stuff
        doSomeFooWithDom();
        checkSomeBarHere();
        updateSomeValuesThere();

        // now call the function again with different values 

        // THIS IS WHAT MY QUESTION REFERS TO **************
        if ( true ) {
            ajaxLoadSth(newValue, newAttribute);
        }
    });
}
function ajaxLoadSth(value, attribut



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: