Test url availability with javascript
问题 Is it possible through jQuery (or plain javascript) to test if a webpage on another domain is available? I tried getting the response headers with an ajax-call but I get an error no matter what site outside my own domain I test. So do I really need a proxy script on my server or would I be able to skip that request? 回答1: Yes, you need to use a proxy script on your server. JavaScript cannot be used in a browser to request resources across domains, as per the same-origin policy. 回答2: Is it