[wp-hackers] Protocol Relative URLs and wp_register_script()
Leho Kraav
leho at kraav.com
Mon Mar 3 14:07:43 UTC 2014
On 03.03.2014 15:54, Mike Walsh wrote:
> Over the weekend I received a patch for one of my plugins which changes how
> I load a jQuery script from the Microsoft CDN. The change removes the
> "http:" from the URL leaving the remainder, including of the URL including
> the "//". The purpose of this change is to avoid mixcontent warnings when
> serving the site over https.
>
> I was a bit leery of making the change as submitted but did some reading
> and found this article:
>
> http://www.paulirish.com/2010/the-protocol-relative-url/
>
> Is there a better way to support this within WordPress or is this solution
> generally accepted as the right way to do it?
I for one don't know any better way and enqueue all my stuffs with //.
Why would one start messing with is_ssl() or whatnot and prefixing
protocols based on results or whatnot, I don't know.
More information about the wp-hackers
mailing list