2017-05-26 30 views

回答

0
window.setInterval(function() { 

$.ajax({ 
    url: 'http://www.example.com/somefile.ext', 
    type: 'HEAD', 
    error: function() { 
     //file not exists 
    }, 
    success: function() { 
     //file exists 
    } 
}); 

     }, 5000); // you can change this time interval as you want 

代碼用於檢查404種狀態,

function UrlExists(url) { 
     var http = new XMLHttpRequest(); 
     http.open('HEAD', url, false); 
     http.send(); 
     return http.status != 404; 
    } 
0

該文件是在PHP側創建- 用於sure-
所以有一個特定的代碼塊這樣做。

所以你知道從哪裏開始。

現在當文件被創建時,取決於你想在何處,何時以及如何存儲或顯示「確認」...有很多選項。我建議你閱讀PHP file_put_content
在代碼中找到它並嘗試一些。

相關問題