6 examples of 'html onclick goto url' in JavaScript

Every line of 'html onclick goto 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
this disclaimer
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}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

210openExternalLink(href) {
211 const a = document.createElement('a')
212 a.href = link
213 a.target='_blank'
214 a.click()
215}
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}
168function gotoLink( s )
169{
170 $.mobile.changePage( s );
171}
126function gotobk(obj) {
127 var loc = obj.toString().trim();
128 LaunchBar.openURL(loc);
129}
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}

Related snippets