Programming Tips - How can I call home with the same protocol as me?

Date: 2014nov27 Product: web Language: javaScript Q. How can I call home with the same protocol as me? A. Instead of doing:
- See what protocol I am using (ie http or https) and use that.
You can do simply not use http or https so your url will begin with //
$.get('//another_folder/another_url.php', function() { });
If its in the same folder as you, you can even leave off the //
$.get('another_url_in_same_folder.php', function() { });
That above code uses jQuery but this isn't limited to jQuery