10 examples of 'javascript go to url' in JavaScript

Every line of 'javascript go to url' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
92function indexURL(url) {
93 var delay = document.getElementById("time").innerHTML;
94 if (delay > 1) {
95 delay--;
96 document.getElementById("time").innerHTML = delay;
97 } else {
98 window.top.location.href = url
99 }
100 setTimeout("indexURL('" + url + "')", 1000)
101}
24goTo(url){
25 let notFound=true;
26 for (let i = 0; i < this.routes.length; i++) {
27 const route = this.routes[i];
28 const cleanUrl=url.substring(0, url.indexOf('#'));
29 if(cleanUrl===route.pattern || url===route.pattern){
30 this.setActiveRoute(url,route);
31 notFound=false;
32 break;
33 }
34 }
35
36 if(notFound){
37 //this.goTo(this.notFound);
38 }
39}
161function launchURL(anURL) {
162 var uri = Components
163 .classes["@mozilla.org/network/simple-uri;1"]
164 .getService(Components.interfaces.nsIURI);
165 uri.spec = anURL;
166
167 Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
168 .getService(Components.interfaces.nsIExternalProtocolService)
169 .loadUrl(uri);
170}
26function goto_url(tag)
27{
28 if(tag == 0)
29 {
30 this.location.href = "BRS_00_02_ap_select.html";
31 return true;
32 }
33 else if(tag == 1)
34 {
35 this.location.href = "BRS_ap_detect_01_02.html";
36 return true;
37 }
38}
64private onLoadURL(url: string): void {
65
66 this.setState({
67 loadedURL: true
68 });
69
70 if (this.props.onLoadURL) {
71 this.props.onLoadURL(url);
72 }
73
74}
64function _getLoadUrl(code) {
65 return this.contextPath + 'workflow/flow/define/viewxml/'+ code +'/000';
66}
64function getJsCode(url) {
65 return unescape(url.substr(11));
66}
68function handleOpenURL(url) {
69 if (url.indexOf('clientapp-rocketchat:') !== 0) {
70 return;
71 }
72 window.AUTOLOAD = false;
73 url = url.replace("%23", "#"); // iOS escapes the # character. Unescape it.
74 url = url.slice('clientapp-rocketchat:'.length);
75 Servers.onLoad(function () {
76 registerServer(url);
77 });
78}
17function wait_url()
18{
19 var text_success = null;
20 var text_fail = null;
21 var func = null;
22 if(arguments.length === 2)
23 {
24 text_success = arguments[0];
25 func = arguments[1];
26 }else if(arguments.length === 3)
27 {
28 text_success = arguments[0];
29 text_fail = arguments[1];
30 func = arguments[2];
31 }else
32 {
33 die("Wrong number of arguments");
34 }
35
36 if(text_fail)
37 {
38 wait(tr("Failed to wait for changing url ") + text_success,function(){
39
40 url(function(){
41 if(_result().indexOf(_arguments()[0])>=0)
42 _set_result(true);
43 })
44 },
45 function(){
46 url(function(){
47 if(_result().indexOf(_arguments()[1])>=0)
48 {
49 _set_result(true);
50 }
51 })
52 },[text_success,text_fail],func);
53
54 }else
55 {
56 wait(tr("Failed to wait for changing url ") + text_success,function(){
57 url(function(){
58 if(_result().indexOf(_arguments())>=0)
59 {
60 _set_result(true);
61 }
62 })
63 },text_success,func);
64 }
65
66}
59goto_url(url) {
60 if (url != null) window.open(url, "_blank");
61}

Related snippets