JQuery check if url exist No 'Access-Control-Allow-Origin' -


i'm trying check if url exist using jquery , following

checking url in jquery/javascript

however getting

xmlhttprequest cannot load http://10.16.20.22:8080/xxx. no 'access-control-allow- origin' header present on requested resource. origin 'http://localhost' therefore not allowed access.

my question how can check if url exist?

here datatype: jsonp cross-domain request, means request different domain datatype: json same domain-same origin request.

function urlexists(url, successcallback) {   $.ajax({     url: url,     datatype: "jsonp",     statuscode: {       200: function(response) {         console.log('status 200');         successcallback();       },       404: function(response) {         console.log('status  404 ');       }     }   }); } urlexists("http://google.com", function() {   console.log('side exists got executed'); }); 

codepen link http://codepen.io/anon/pen/waevmv


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -