cmd/browser: show friendlier error message when key missing from URL

Change-Id: I4f2da3f7a198be3012f569d33a317273967971a8
Reviewed-on: https://upspin-review.googlesource.com/13040
Reviewed-by: Rob Pike <r@golang.org>
diff --git a/cmd/browser/static/script.js b/cmd/browser/static/script.js
index 835b633..634e3bb 100644
--- a/cmd/browser/static/script.js
+++ b/cmd/browser/static/script.js
@@ -733,9 +733,14 @@
 	// Obtain a request key.
 	var prefix = "#key="
 	if (!window.location.hash.startsWith(prefix)) {
-		// TODO(adg): make this more user-friendly,
-		// even though it will not happen often.
-		alert("No key provided in URL fragment.");
+		$("#mLoading").modal("show").find(".up-error")
+			.show().find(".up-error-msg")
+			.text("No request key in browser URL.\n\n" +
+				"To use the Upspin browser, click the URL\n" +
+				"that it printed to the console.\n\n" +
+				"It will look something like\n" +
+				" http://localhost:8000/#key=3f0cf1e29...\n" +
+				"but with a different hash.");
 		return;
 	}
 	page.key = window.location.hash.slice(prefix.length);