国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

javascript - ajax how to request php, php not running
僅有的幸福
僅有的幸福 2017-05-27 17:41:54
0
8
849

The requirement is like this, I have an ajax polling, requesting a php, php actively pushes messages to specific WeChat users, there is no output content,
I just want it to run, but the actual situation is that there is no output, it Not running.
I did a test, a code in php generates a file. Then a page runs ajax to request this php. No files are generated in the directory, but files are generated when running php directly, which means there is nothing wrong with my php. Below is the ajax code, take a look

<script>
   function aj(){
       $.ajax({
           type: 'get',
           dataType: 'html',
           url: '/wechat/Wechatqyzj/ajaxPoll',
           success:function(result){
            //alert(result);
       }
       });
   }
   $(document).ready(function(){
      setInterval('aj()',3000);
   });
</script>
僅有的幸福
僅有的幸福

reply all(8)
曾經(jīng)蠟筆沒有小新

The header function can call the request, please try it. Or just make an ajax request

滿天的星座

Post the php code, ajax can’t see anything

滿天的星座

Access this api address directly. If there is normal data (for example: a json data is displayed on the page), the writing method of the timer here should be

setInterval(aj,3000);

小葫蘆

Can the URL not be written in .php?

黃舟

Tell me a few things that I think may be wrong
1.Success is not output, and I should also complete the error
2. If you are not sure about the request address, please write the absolute address
3. Paste the php code. It is very likely that there is an error in the backend

僅有的幸福

Use the developer mode of Google Chrome to see if an ajax request is initiated and what data the request returns, and then do further troubleshooting

左手右手慢動作

Both ends can be debugged:
1. Browser side: Press F12 to bring up the developer tools, and check whether there are network requests in the Network panel. If not, it means the method is not executed. You can check if there is any error in the Console panel. F12 調(diào)出開發(fā)者工具,在 Network 面板中查看是否有網(wǎng)絡請求。沒有的話說明方法沒有執(zhí)行,可以看看 Console 面板中有沒有報錯。
2.服務器端:如果瀏覽器請求發(fā)送成功,那么說明服務器收到了請求。可以用 die()2. Server side: If the browser request is sent successfully, it means that the server has received the request. You can use die() to breakpoint debugging.

In addition, it is recommended to capitalize the $.ajax() 方法中的 type value.

Peter_Zhu

First of all, it is impossible not to run without output. Please post the code. Or set some breakpoints to debug it yourself.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template