0
0

More than 3 years have passed since last update.

ajax通信のreturnについて【個人メモ】

Last updated at Posted at 2020-04-16

【コメントで質問OKです】
.done,.failの外でreturnすること

var getEventInfo = function(roomID){
    console.log(TGVC.sru + "/api/room/event_and_support?room_id=" + roomID)
    $.ajax({type: 'GET',url: TGVC.sru + "/api/room/event_and_support?room_id=" + roomID, async: false})
    .done(function(re) {
        console.log(re);
        eventInfo = re;
    })
    .fail(function() {
        // room_info = null;
    });
    return eventInfo;    //.done,.failの外で実行
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0