Reputation: 140
I need to check the whether an external url like http://www.example.com exists or not using javascript or ajax.
Thanks in advance..
Upvotes: 3
Views: 193
Reputation: 1075427
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.
Upvotes: 3