We have a widget that is embedded in various website. We would like the widget to make an ajax call to our server according to the protocol (http or https) of the website in which we are embedded. Is there a common practice to do that?
Using a protocol agnostic url (see below) doesn't work:
$.ajax({
url : '//cdn.example.com/serviceName',
...
});
Wouldn´t this work?