website: fix JavaScript error on website and blog in non-ES6 browsers

In Safari a JavaScript error in personalizeInstallInstructions prevents
the featured articles from displaying. startsWith is an ES6-only feature.

Fixes golang/go#12283

Change-Id: I9f471362cdac0243758e482ed3a21b0d6aa48c8b
Reviewed-on: https://go-review.googlesource.com/13841
Reviewed-by: Andrew Gerrand <adg@golang.org>
This commit is contained in:
Nathan Youngman 2015-08-23 13:25:07 -06:00 committed by Andrew Gerrand
parent 93604a3dc2
commit 6c9aff3429
2 changed files with 2 additions and 2 deletions

View File

@ -248,7 +248,7 @@ function toggleHash() {
function personalizeInstallInstructions() {
var prefix = '?download=';
var s = window.location.search;
if (!s.startsWith(prefix)) {
if (s.indexOf(prefix) != 0) {
// No 'download' query string; bail.
return;
}

View File

@ -813,7 +813,7 @@ function toggleHash() {
function personalizeInstallInstructions() {
var prefix = '?download=';
var s = window.location.search;
if (!s.startsWith(prefix)) {
if (s.indexOf(prefix) != 0) {
// No 'download' query string; bail.
return;
}