html - Javascript reference without protocol - (starting with //) -
i develope plugin being used in thousands of websites. code install plugin includes reference javascript without protocol, example:
//www.mysite.com/js/script.js
this works fine on majority of websites, requesting https or http version depending on current protocol.
however, time time, let's 0,5%, there websites don't recognize way of referencing js script. when website code find:
http://www.userwebsite.com//www.mysite.com/js/script.js
this not browser specific issue, because test browser , still have issue.. it's more website specific problem.
i've read everywhere recommended practice, , can't find source of problem. ideas?
- of sites use plugin wordpress sites - js reference included directly html, inside body
if it's in website code (the html source) can't browser or javascript issue. assumed correctly, must server side problem.
maybe pages plugin placed on converting links. , don't recognize double slashes think it's relative url on server hence prepending protocol , domain.
maybe use sort of code optimization / javascript minification changing links.
Comments
Post a Comment