I need to see if a file exist on another server. So if I called http://www.someotherserver.com/index.html if the page is there it returns true and if not it returns false. I gave this a try:
$.ajax({
type: 'HEAD',
url: 'http://localhost/HTMLPage1.htm',
success: function () {
},
error: function () {
alert("Unable to connect to secure checkout.");
return false;
}
});
But it returns an error every time. I was thinking maybe because of cross-domain scripting. Does anyone know how to make this work or have a method that does work?
Thanks!
Just set
crossDomaintotruein your code, like this: