ajax redirection not working

ajax redirection not working

Hi I am using the Paypal API, this was all working fine a year ago then the project was put on hold, last year it was working via http I have changes this to https. The returning json object was stripped and the page went to the paypay url, to complete the transaction. Now nothing fires.

here is the code

$.ajax({ url: 'php/checkout123.php', data: {my_json_data: json}, type: 'POST', //async: false, dataType: 'json', success:function(data){ if (data.goto) location=data.goto; } });

and the response

www.hullsantarun.org{"goto":"https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout &token=EC-3W625739PV925654X"} I believe this should redirect, the url is valid when I copy into a browser.

thanks