On the client side using jQuery, I want to know if I can just check if a link URL is valid (i.e. doesn't return a 404). This link points to another domain, so if I just use $.get() then I end up with a permission issue. I remember reading something about using a JSONP request, but I don't remember.
Jquery – Use jQuery to check if a URL on another domain is 404 or not
cross-sitejquery
Related Topic
- Javascript – Get current URL with jQuery
- Javascript – How to check whether a checkbox is checked in jQuery
- Html – Use jQuery to hide a DIV when the user clicks outside of it
- Javascript – Check if checkbox is checked with jQuery
- Javascript – How to check a radio button with jQuery
- Javascript – jQuery’s jquery-1.10.2.min.map is triggering a 404 (Not Found)
Best Answer
I found a solution that seems to work (using YQL):
Assumes the URL you want to check is in the variable 'url'.