ajax - Server says the request went through but client says error -


i building web app , server using nodejs , express. when make request server browser works fine, when try ajax request client registers on server, gives me error on client. here using ajax request:

$.ajax({     async: false,     datatype: "json",     url: url,     crossdomain: true,               success: function(response) {},      error: function(response){         alert(json.stringify(response));     } }); 

on server side, when send request... set header of response allow cors: >>

res.writehead(200,{     'access-control-allow-origin' : '*' }); 

in place of '*', can specify set of urls, want server response to...


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -