Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will jQuery $.ajax without full url remain https if original page load was https?

Tags:

jquery

ajax

https

Will the following jQuery AJAX request use HTTPS if the original web page load was via HTTPS?

$.ajax({
  url: 'ajax/test.html',
  success: function(data) { alert(data); }
});
like image 292
harrije Avatar asked Mar 21 '26 02:03

harrije


1 Answers

Yes, a relative URL works relative to the current host, protocol and port.

like image 135
Gerry Avatar answered Mar 23 '26 16:03

Gerry



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!