Pattern for wrapping an Asynchronous JavaScript function to make it synchronous

前端 未结 7 1462
迷失自我
迷失自我 2020-12-09 04:33

I\'m working with a JavaScript API where most of the functions are asynchronous. The API is the WebKit JavaScript Database API which is a binding to a subset of functionali

7条回答
  •  醉话见心
    2020-12-09 04:45

    if you are using jQuery Ajax : $.ajax()

    you can set the attribute of asynch to false , and then you will have a synch ajax request to the server.

提交回复
热议问题