jQuery check external link

后端 未结 3 362
醉酒成梦
醉酒成梦 2020-12-21 15:12

Using Javascript or jQuery, how can I check if an external link is available?

An $.ajax() call is not available as it violates SOP (same problem as her

3条回答
  •  臣服心动
    2020-12-21 15:57

    Do you have access to server side languages? You could use AJAX to call a local file which uses something like PHP to check the external address.

    If you need help with the PHP part, have a look at http://www.catswhocode.com/blog/amazing-things-to-do-with-php-and-curl

提交回复
热议问题