8 examples of 'window location href in php' in JavaScript

Every line of 'window location href in php' 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
231function after_setWindowLocation(win, url) {
232 goog.dom.safe.setLocationHref(win.location, url);
233}
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

37function redirectbasehref(el, responseText) {
38 var mo = responseText.match(/<base href="(\S+?)"/i);
39 if (mo.length === 2) {
40 return mo[1];
41 }
42 return location;
43}
7export function opensInWindow(url: string) {
8 return whitelist[normalizeURL(url)];
9}
5function windowLocation(key, value) {
6 var keywords = (key == 'keywords' ? value : getURLParameter('keywords'));
7 var method = (key == 'method' ? value : getURLParameter('method'));
8 var forms = (key == 'forms%5B%5D' ? value : getURLParameter('forms%5B%5D'));
9 var projects = (key == 'projects%5B%5D' ? value : getURLParameter('projects%5B%5D'));
10 var pageCount = (key == 'page-count' ? value : getURLParameter('page-count'));
11 var order = (key == 'order' ? value : getURLParameter('order'));
12 var page = (key == 'page' ? value : getURLParameter('page'));
13
14 var parameters = [];
15 if (keywords) { parameters.push("keywords=" + keywords); }
16 if (method) { parameters.push("method=" + method); }
17 if (forms) { parameters.push("forms%5B%5D=" + forms); }
18 if (projects) { parameters.push("projects%5B%5D=" + projects); }
19 if (pageCount) { parameters.push("page-count=" + pageCount); }
20 if (order) { parameters.push("order=" + order); }
21 if (page) { parameters.push("page=" + page); }
22
23 return (parameters ? window.location.pathname + "?" + parameters.join("&") : window.location.pathname);
24}
194function getLocation(url) : URLLocation {
195 var parts = /([^\?]*)\/*(\??.*)/.exec(url);
196 return {
197 base: parts[1],
198 queryString: parts[2]
199 };
200}
76function createHref(location) {
77 return history.createHref(resolveLocation(location));
78}
316function WWHBrowser_ReplaceLocation(ParamFrameReference,
317 ParamURL)
318{
319 var EscapedURL;
320
321
322 EscapedURL = WWHBrowserUtilities_EscapeURLForJavaScriptAnchor(ParamURL);
323 setTimeout(ParamFrameReference + ".location.replace(\"" + EscapedURL + "\");", 1);
324}
11function getLocation(url){
12 var search,
13 a = document.createElement('a'),
14 params = utils.serializeParam(me.queryCommandValue('serverparam')) || '';
15
16 a.href = url;
17 if (browser.ie) {
18 a.href = a.href;
19 }
20
21
22 search = a.search;
23 if (params) {
24 search = search + (search.indexOf('?') == -1 ? '?':'&')+ params;
25 search = search.replace(/[&]+/ig, '&');
26 }
27 return {
28 'port': a.port,
29 'hostname': a.hostname,
30 'path': a.pathname + search || + a.hash
31 }
32}

Related snippets