mirror of
https://github.com/yogeshojha/rengine.git
synced 2026-09-20 16:57:43 +02:00
13 lines
376 B
JavaScript
13 lines
376 B
JavaScript
// https://stackoverflow.com/a/11384018
|
|
function openInNewTab(href) {
|
|
window.open(href, '_blank');
|
|
window.focus();
|
|
}
|
|
|
|
// seperate hostname and url
|
|
// Referenced from https://stackoverflow.com/questions/736513/how-do-i-parse-a-url-into-hostname-and-path-in-javascript
|
|
function getParsedURL(url) {
|
|
var parser = new URL(url);
|
|
return parser.pathname+parser.search;
|
|
};
|