I develope a plugin that is currently being used in thousands of websites. The code to install the plugin includes a reference to a javascript without the protocol, for example:
//www.mysite.com/js/script.js
This works fine on the majority of the websites, requesting from https or http version depending on the current protocol.
However, from time to time, let's 0,5%, there are websites that don't recognize this way of referencing a js script. When I look the website code I find:
http://www.userwebsite.com//www.mysite.com/js/script.js
This is not a browser specific issue, because I test it with any browser and I still have the issue.. it's more a website specific problem.
I've read everywhere that this is the recommended practice, and can't find the source of the problem. Any ideas?
- Most of the sites that use the plugin are WordPress sites
- The js reference is included directly into the HTML, inside the body