2017-05-26 31 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
在代码中找到它并尝试一些。

相关问题