- 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