Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting a page to open in a new borderless window

Is there a way to force a page to open in a new window all the time regardless of the link used to open it? By adding something to the header perhaps? I know about target-"new" and window.open() but i want the page itself to always open as a new window with no toolbars or scrollbars shown even if the link used to open it is generic () with no target="new" or similar specified. I am only concerned with Internet explorer.

Thanks in advance.

like image 250
Admir O Avatar asked Mar 23 '17 01:03

Admir O


1 Answers

I actually found a nice example here

here's the snippet (you might need to type this in a text editor and open that html file first because I don't seem to be getting it working on StackOverflow alone)

I hope this is what you are looking for.

<html>
<head>
<title>Opening Multiple Popup Windows</title>

<script language="javascript">
<!--//
function myPopup(url,windowname,w,h,x,y){
window.open(url,windowname,"resizable=no,toolbar=no,scrollbars=no,menubar=no,status=no,directories=n o,width="+w+",height="+h+",left="+x+",top="+y+"");
console.log("Opening: " + windowname);
}
//-->
</script>
</head>
<body>
<!-- Inside the parenthesis the order goes URL, window name, width, height, position from left, position from top-->
<!-- Note that by giving each popup window a different name each page will open in a seperate popup window-->
<a href="javascript:myPopup('http://www.cnn.com', 'CNN','300','300','10','300')">Open popup 1</a>
<br>
<a href="javascript:myPopup('http://example.com', 'Example.com','300','300','100','300')">Open popup 2</a>
<br>
<a href="javascript:myPopup('http://www.nbc.com', 'NBC','300','300','200','500')">Open popup 3</a>
</body>
</html>
like image 143
CrazyInfin8 Avatar answered Sep 21 '22 21:09

CrazyInfin8