I have to redirect with ajax to different domain. There is bank page. In Php I get adres to redirect when I use function header I got a error in ajax XMLHttpRequest cannot load so I want to pass this using echo and i changed dataType:"text", but I can not redirect. Please help me.
$.ajax({
type: "POST",
url: "/module/payu/paymentMethods",
header:'Access-Control-Allow-Origin',
data: '{ "name":"'+val+'" }',
contentType: "application/json",
crossDomain:false,
success: function(data) {
console.log('Super' +val);
},
dataType:"JsoP",
error: function(jqXHR, textStatus, errorThrown) {
console.log(jqXHR,textStatus, errorThrown);
}
});
echo ("<script>window.location.href='$url'</script>");
// header("Location:".$url,true);