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?

fiddle code

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

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -