JQuery - SSL $ .post

If I serve the page via SSL and I make an AJAX message:

$.post('/core/somepage.php', ....); 

Will the message be generated via HTTPS, or do I need to specify an absolute URL, for example:

$.post('https://example.com/core/somepage.php', ....);

In addition, this applies to:

 $('#element').load('/core/something.php'); 

?

+6
source share
1 answer

Yes, the message will be made through https . Relative paths, by definition, use the current schema. Did you know that you can do something like //example.com/somepage if you want to go to an explicit host but save the current scheme.

+7
source

Source: https://habr.com/ru/post/923205/


All Articles