javascript - Testing server's response -
i have form in angular app in user required provide valid url. therefore when submitting form, i'd test if url valid making request url provided , check if server sends 200.
when click submit button, following code run:
$http.get(scope.target_url).success(function(){ // code }).error(function(error){ console.log(error); });
however, never successfull answer: - if provide url like: 'http://www.somesite.com', get:
xmlhttprequest cannot load 'http://www.somesite.com'. received invalid response. origin 'mydomain' therefore not allowed access.
if provide url like: 'http://somesite.com', get:
xmlhttprequest cannot load http://somesite.com/. no 'access-control-allow-origin' header present on requested resource. origin 'mydomain' therefore not allowed access.
where problem come from?
that normal security constraints. read cors here:
Comments
Post a Comment