Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If I make a request to page.php (AJAX) with JavaScript from a HTTPS page, the request is automatically made ​​page.php directly with HTTPS or HTTP? If HTTP, how to send a request (to the same domain) with HTTPS with pure JavaScript?

share|improve this question

More information is needed to be 100% sure (code sample, framework, ...), but the likely answer is yes.

If you POST with a relative URL, then the same host/port as the current page will be used.

You can open Chrome/Firefox's inspector to see how the browser actually made the request.

If you give the browser an absolute URL, then you can specify the http/https in the URL.

share|improve this answer
Someone edited my answer, but the comma they removed was not an optional comma in English. Please don't edit my answers to use improper grammar. – whitehat101 Oct 19 '13 at 23:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.