Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTPS request via AJAX from HTTP page

Tags:

ajax

https

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?

like image 590
Duncan Avatar asked Jun 18 '09 13:06

Duncan


People also ask

Does AJAX work with https?

You cannot make an AJAX request to an https page if you are currently in http because of the Same Origin Policy. The host, port and scheme (protocol) must be the same in order for the AJAX request to work.

Can we send request from https to HTTP?

You can't. Browsers prevents this by default as otherwise it would be insecure to allow it. The remote server must have a valid SSL certificate and use HTTPS.

Are AJAX requests HTTP requests?

An AJAX request is a request made by an AJAX application. Typically, it is an HTTP request made by (browser-resident) Javascript that uses XML to encode the request data and/or response data.

Can we use HTTP GET or POST for AJAX calls?

jQuery - AJAX get() and post() Methods. The jQuery get() and post() methods are used to request data from the server with an HTTP GET or POST request.


1 Answers

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

like image 112
AnthonyWJones Avatar answered Sep 23 '22 08:09

AnthonyWJones