Call php function in javascript without waiting for response

后端 未结 3 767
野趣味
野趣味 2021-01-29 09:03

I know how to use $.ajax. I have a Codeigniter project so I just call:

url:\'\', 

3条回答
  •  礼貌的吻别
    2021-01-29 09:45

    Do you can try this ? Change the (alert) function with your function

      $.ajax({
                url: 'test.html',
                async: false,
                success: function () { alert('hello people from the world'); }
            });
    

    Never use async: false. Since Javascript runs on the UI thread, an async: false request will freeze the browser until the server replies

提交回复
热议问题