Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open a window behind the current window using Javascript/jQuery

I want to open a window on click, but I want to open it behind the current window, or when the new window opens it should minimize itself. I have made a function but it actually did not work.

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
function wn(){
  var mm=window.open('http://www.google.com','newwindow','width=200, height=200', "_blank");
}
</script>
</head>
<body>
<a href="#" onclick="wn()">click</a>
</body>
like image 597
Jitender Avatar asked Jul 10 '12 05:07

Jitender


People also ask

How can we open a window in JavaScript?

Javascript | Window Open() & Window Close() Method URL: It is an optional parameter. It is used to set the URL of web pages which need to open. If URL is not set then window. open() method open a blank window.

How do I open a pop up window?

The syntax to open a popup is: window. open(url, name, params) : url. An URL to load into the new window.

What is the second parameter of window open () method?

The target parameter determines which window or tab to load the resource into, and the windowFeatures parameter can be used to control to open a new popup with minimal UI features and control its size and position.


1 Answers

popunder = window.open('http://www.google.com','newwindow','width=200, height=200', "_blank");
popunder.blur();
window.focus();
like image 147
odupont Avatar answered Sep 20 '22 03:09

odupont