Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 604
schwift Avatar asked May 14 '26 18:05

schwift


1 Answers

Is it possible through jQuery (or plain javascript) to test if a webpage on another domain is available?

Due to same origin policy restriction you need a proxy/bridge on your server unless the remote server implements JSONP which obviously we cannot assume for the general case.

like image 130
Darin Dimitrov Avatar answered May 17 '26 07:05

Darin Dimitrov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!