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

后端 未结 6 1402
失恋的感觉
失恋的感觉 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条回答
  •  萌比男神i
    2020-12-14 08:33

    Update for reference (2015):

    This is available in current versions of jQuery:

    $.when($.ready).then(...);
    

    It is also simple to convert to a stream using highlandjs:

    _($.when($.ready)).map(transform).pipe(output) // etc.
    

提交回复
热议问题