Can I get a jQuery Deferred on document.ready()?

后端 未结 6 1411
失恋的感觉
失恋的感觉 2020-12-14 07:47

Right after my script is loaded I am making an Ajax request to get some translations. This should always return after the document is ready since I am loading my scripts at

6条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-14 08:48

    Try this:

    $.when($.ajax('translations'), $.ready).then(function() {
        // Start doing stuff here
    });
    

提交回复
热议问题