Every line of 'javascript redirect to relative 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.
68 function redirect(text = null) { 69 if (text == null) { 70 text = document.querySelector('#search-box').value; 71 } 72 location.href = '/?q=' + encodeURIComponent(text); 73 }
50 function redirect() 51 { 52 if (second < 0) 53 { 54 55 location.href = '/sba'; 56 } else 57 { 58 if (navigator.appName.indexOf("Explorer") > -1) 59 { 60 document.getElementById('totalSecond').innerText = second--; 61 } else 62 { 63 document.getElementById('totalSecond').textContent = second--; 64 } 65 } 66 }
310 function redirect(url) { 311 var 312 hash_pos = url.indexOf('#'), 313 query_pos = url.indexOf('?'), 314 hash = ''; 315 if (hash_pos >=0 ) { 316 hash = url.substring(hash_pos); 317 url = url.substring(0, hash_pos); 318 } 319 url = url + (query_pos >= 0 ? '&' : '?') + 't=' + new Date().getTime() + hash; 320 console.log('redirect to: ' + url); 321 location.assign(url); 322 }
519 function redirectTo(url) { 520 setBubbleText(t('redirecting', { hostName: util.hostNameFromUri(url) })); 521 addClass(elements.bubble, 'one-line'); 522 setTimeout(function() { 523 document.location = url; 524 }, 500); 525 }
62 function redirect(url, param) { 63 if (!url) 64 return; 65 66 var _param = param || {}; 67 var formId = 'redirectForm' + new Date().getTime(); 68 var formHtml = "".format(formId, url); 69 70 Object.keys(_param).forEach(function (aProperty) { 71 if (_param[aProperty]) { 72 formHtml += "".format(aProperty, _param[aProperty].toString()); 73 } 74 }); 75 76 formHtml += ''; 77 $(formHtml).appendTo('body'); 78 79 $('#' + formId).submit(); 80 }
47 function redirectBrowserTo(url) 48 { 49 $window.location.href = url; 50 }