harrije harrije - 2 years ago 93
Ajax Question

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

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

url: 'ajax/test.html',
success: function(data) { alert(data); }

Answer Source

Yes, a relative URL works relative to the current host, protocol and port.
It works only with the $.ajax method. With the short-hand function $.get() or $.post() it doesn't work.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download