18F / dashboard

DEPRECATED: A site to track our projects' status and much, much more...
Other
44 stars 25 forks source link

Parse the root from the document's URL properly #216

Closed mbland closed 9 years ago

mbland commented 9 years ago

Given the https:// scheme used by https://18f.gsa.gov/, the '7' used in the original script was off-by-one, causing the error:

Failed to load resource: net::ERR_NAME_NOT_RESOLVED

in the JavaScript console for the computed value:

https://api/data/team.json

because the hostname was not corectly parsed. This change ensures the script works for both http:// and https:// schemes. Tested by hardcoding a value for var url with both http:// and https:// schemes for 18f.gsa.gov.

cc: @gboone @wslack @yozlet

yozlet commented 9 years ago

:+1: