jsdefer icon indicating copy to clipboard operation
jsdefer copied to clipboard

Urls beginning with // are converted to relative path.

Open wforney opened this issue 13 years ago • 3 comments

This may seem like a helper, but the :// search on line 261 should just be // because you then don't have to worry about whether it's ssl or not and can pass in a script path like this:

//www.mysite.com/scripts/whatever.js

and it will use http or https depending on what mode the page is in. if you force urls to have http: or https: in them then we have to do an unnecessary script check for ssl and provide an alternate url.

that may be an option to add to this... I might suggest the following:

minurl = local min url on your domain url = local url on your domain cdnminurl = CDN min url cdnurl = CDN url

and then add ssl to all those for ssl versions. unless you want to add the ssl check in the loader itself and have it change the script urls appropriately...?

wforney avatar Mar 19 '11 17:03 wforney

note that some scripts' urls are not just as simple as flipping http:// to https:// ... facebook was guilty of this before, and there are others, where they add ssl. to the host and such... jquery is one. their cdn doesn't support https so i have a check on it and use theirs for non-ssl and another one for https...

wforney avatar Mar 19 '11 17:03 wforney

one other thing that is a gripe of mine, though i understand why it isn't always a best practice to do this, is the lack of a way to say give me the latest version on the msft cdn. the google one has it but it has performance issues on theirs. (change version number from 1.5.1 to 1 on theirs and it works and gives latest version of 1.x.x, similarly, 1.5 does the same thing)

wforney avatar Mar 19 '11 17:03 wforney

I hope to look into these suggestions, but it may be a little while before being able to address them...

BorisMoore avatar Apr 06 '11 18:04 BorisMoore