开发者

Javascript: How to check the existence of a url?

I need to check the whether an external url like http://www.example.com exists or not using开发者_如何转开发 javascript or ajax.

Thanks in advance..


You can load it into a hidden iframe and see if you get content. You can't use "ajax" (e.g., an XMLHttpRequest call) for it, because you'll run into Same Origin Policy restrictions.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜