Ajax检测网址是否有效

前端开发   发布日期:2023年05月01日   浏览次数:503
  1. <script src="js/jquery.min.js" type="text/javascript" charset="gbk" ></script>
  2. <script>
  3. function get_url_status(){
  4. $.ajax({
  5. url: '22.php',
  6. type: 'POST',
  7. complete: function(response) {
  8. if(response.status == 200) {
  9. alert('有效');
  10. } else {
  11. alert('无效');
  12. }
  13. }
  14. });
  15. }
  16. </script>
  17.  
  18. <input name="2" type="button" value="检测"  onclick="get_url_status()" />


以上就是Ajax检测网址是否有效的详细内容,更多关于Ajax检测网址是否有效的资料请关注九品源码其它相关文章!