brebory / thinkful-fewd-best-practices

Repository for Thinkful's FEWD Mentors to compile information about front end best practices.
MIT License
3 stars 3 forks source link

Explain // protocol #6

Open jescalan opened 10 years ago

jescalan commented 10 years ago

You load jquery with a // protocol without explaining this. I've seen newer developers be confused by this before, a simple comment indicating that this allows loads from http or https could help a lot. Also if I'm not mistaken, using // on localhost breaks the load, as it tries to load from file://, so it might be best to just use http:// here, since it's pretty unlikely that beginning developers will be serving up their sites with https

brebory commented 10 years ago

This example conditionally loads jQuery from a local file if you're developing on localhost.

A more in-depth explanation of this technique is definitely needed, though.

brebory commented 10 years ago

@jenius I understand what you were saying now - I merged your changes to use http:// instead, so I think we can close this issue without adding an explanation of //.

Unless you think mentioning both would be worth it?

jescalan commented 10 years ago

Nah, less things to explain, less confusion. :+1: