HTTPS request via AJAX from HTTP page

2019-01-09 00:31发布

问题:

Would there be any problems calling an HTTPS page (e.g. a credit card authorisation service i.e. WorldPay) from a standard HTTP page via AJAX?

I can't imagine why there would be a problem, the response would be an HTML page which I could then embed in a result pane or such like?

回答1:

Yes this would be a Cross domain posting and would be blocked by the browser.



回答2:

Anthony is right, but what you could do is create a local page the AJAX calls and that communicates with the HTTPS service via cURL or something else and returns. That way everything is done locally according to Java script.



标签: ajax https