Showing the changes to script-archive/example/scripts/locationExample.js (1 of 401 files). Show all
Unified · Split
| @@ -0,0 +1,11 @@ | |||
| 1 | var goto = Window.prompt("Where would you like to go? (ex. @username, #location, 1.0,500.3,100.2)"); | ||
| 2 | var url = "hifi://" + goto; | ||
| 3 | print("Going to: " + url); | ||
| 4 | location = 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) | ||
| 8 | print("URL: " + location.href); | ||
| 9 | print("Protocol: " + location.protocol); | ||
| 10 | print("Hostname: " + location.hostname); | ||
| 11 | print("Pathname: " + location.pathname); | ||