History

archive remaining JS scripts

Andrew Meadows committed 10 years ago

Commit c0b446c1 parent 9556995401 files · +0 −0Browse files

Showing the changes to script-archive/example/scripts/locationExample.js (1 of 401 files). Show all

Unified · Split

script-archive/example/scripts/locationExample.js+11−0
@@ -0,0 +1,11 @@
1var goto = Window.prompt("Where would you like to go? (ex. @username, #location, 1.0,500.3,100.2)");
2var url = "hifi://" + goto;
3print("Going to: " + url);
4location = url;
5
6// If the destination location is a user or named location the new location may not be set by the time execution reaches here
7// because it requires an asynchronous lookup. Coordinate changes should be be reflected immediately, though. (ex: hifi://0,0,0)
8print("URL: " + location.href);
9print("Protocol: " + location.protocol);
10print("Hostname: " + location.hostname);
11print("Pathname: " + location.pathname);