How to open a url in new window without toolbar, menubar
html, javascript
Solution
You have the following issues
- spaces in parms
- most browsers will ignore the status=no and more - scrollbars for example
- you follow the link even if you open the window - return false or as I show, false if the popup did the job, true if not
- no need for form. Links are not form elements and do not have value but href
IF you do not have a popup blocker AND you do not have "open new windows in tabs" THEN this code may work in your browser. If there is a popup blocker, the link still works
function popitup(link) {
var w = window.open(link.href,
link.target || "_blank",
'menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,dependent,width=800,height=620,left=0,top=0');
return w ? false : true; // allow the link to work if popup is blocked
}
<a href="https://www.yahoo.com" onclick="return popitup(this)">yahoo</a>
<a href="https://www.google.com" onclick="return popitup(this)">Google</a>
<a href="https://www.msn.com" onclick="return popitup(this)" target="MSN">MSN</a>
These parms are what I would use
'resizable,width=800,height=620,left=0,top=0'
Problem
here i am trying to open a URL in new window using window.open I have a list of anchor tags with some URL, When i click on those anchor tags the javascript should get the href="" value and pass the value to the javascript function. Here is code what i have done: ``` <html> <head> </head> <script> var a; function popitup(a) { window.open(a, 'open_window', 'menubar=no, toolbar=no, location=no, directories=no, status=no, scrollbars=no, resizable=no, dependent, width=800, height=620, left=0, top=0') } </script> <body> <form name="popup" > <a href="http://www.yahoo.com" onclick="popitup(this.value)">yahoo</a> <a href="http://www.google.com" onclick="popitup(this.value)">Google</a> <a href="http://www.msn.com" onclick="popitup(this.value)">MSN</a> </form> </body> </html> ``` When i click the yahoo, the www.yahoo.com should get opened in new window.. Similarly all but now when i click on those links i am getting the error "server not found" in the new window. How can i solve this?