javascript - Cross domain ajax causing issues to render data -
i trying capture data html form placed on website. form need capture data website. when tried jquery ajax call cross domain shows me 302 error no response.
i've tried this
$('button[type="button"]').on('click', function(){ var data = $('.data-capture-form').serialize(); $.ajax({ type : 'post', url: 'http://prospectbank.co.uk/leads/test', datatype: 'jsonp', crossdomain : true, data : data, contenttype: 'application/jsonp' }).done(function(res){ var resp = $.parsejson(res); console.log(resp); }); }); where problem code? help?
if have access server, add following header:
access-control-allow-origin: * and make jsonp calls
$.ajax({ type: "post", datatype: 'jsonp', ...... etc .... if not have access external server, have direct request server , make proxied call external server.
Comments
Post a Comment