Tag Archives: Javascript

Opening window into tab with window.open() in Chrome

Use this method when you need to open a new window into a tab and not into a popup window through javascript. This should work in most browsers if settings have not been altered. function open_in_tab(url) { var win = window.open(url, ‘_blank’); win.focus(); } Opening window into tab after Ajax Call window.open() will only open […]

Extracting Current Page Handle Using Javascript Location Object

This will extract just the file name portion of the current page. //e.g. location.href = www.domain.com/example.php console_log(location.pathname.substring(1)); //displays: example.php