r/javascript • • Sep 02 '15

HTML5 Deck of Cards. 100% vanilla JS.

http://pakastin.github.io/deck-of-cards/
368 Upvotes

185 comments sorted by

View all comments

5

u/angellus Sep 02 '15

You have Mixed Content errors on your deck.min.js if you load the page over HTTPS (I have HTTPS everywhere install so it loaded automatically).

You should always use // instead of http:// to prevent this from happening. It will attempt to load the resource over the same protocol as the parent page.

2

u/parpaythrums Sep 02 '15

Better yet, use https:// instead!

1

u/angellus Sep 02 '15

No argument there, https should be used everywhere.

This can lead to issues also. I have only seen it lead to issues if you use iFrames that have HTTPS when the parent page is not and you are trying to communicate between the two through the use of sockets.

Your best bet is to use // everywhere and than use nginx or some other Web server to force all requests to HTTPS, but this is just getting into the heavy technical side that OP probably does not care about. // gives you the least possible chance of issues because of mixed content which is why I perfer it.

4

u/MrBester Sep 02 '15

Chrome sends Upgrade-Insecure-Requests: 1 in the headers now.

Using protocol agnostic URLs is now considered an anti-pattern (plus, Content-Security-Policy will snarl at you)

2

u/pkstn Sep 02 '15 edited Sep 03 '15

I don't want to break things up when used from file:// – if you want to try and tinker locally.. I think I'll keep those https://