Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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

1 Answer 1

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
1  
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

 
discard

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.