Dave's Brain

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

Date: 2014nov27
Product: web

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 is limited to jQuery

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.