cross site - Use jQuery to check if a URL on another domain is 404 or not? -
On the client side using JQuery, I want to know if I can only check if a link URL is valid or not (i.e., T 404 comes back). This link points to another domain, so if I only use $ .get (), then the permission problem ends with me. I remember reading something about using a JSONP request, but I do not remember.
I found a solution that looks like (using YQL):
$ GetJSON ("http://query.yahooapis.com/v1/public/yql?" + "Q = Select% 20 *% 20from% 20html% 20where% 20url% 3D% 22" + encodeurIComponent (url) + "% 22 And format = xml 'and callback =? ", Function (data) {if (data.results [0]) {// do anything}});
The url you want to see is in the variable 'url'.