Jump to content

window.open does not work in Google Chrome as it does in Internet Explorer and Firefox

Guest paulo1

Recommended Posts

Guest paulo1

Hello.It seems that "window.open" does not work in Google Chrome as it does in Internet Explorer and Firefox.Consider the page "test.html":<HTML><HEAD><TITLE>Select a page</TITLE><script LANGUAGE="JavaScript">function LaunchPage(url,props) {var windowNew;windowNew = window.open(url,"",props);//alert(props);windowNew.moveTo(0,0);windowNew.focus();}</SCRIPT></HEAD><BODY><TABLE BORDER=1 CELLSPACING=1 CELLPADDING=1 WIDTH=100%><TR><TD ALIGN=CENTER>Select a page</TD></TR></TABLE><TABLE ALIGN=CENTER WIDTH=100% BORDER=1 CELLSPACING=1 CELLPADDING=1><TR><TD ALIGN=CENTER><A HREF="java script:void(0)" onClick="LaunchPage('mypage1.html','screenX=0,screenY=0,width=670,height=420,scrollbars,resizable,st atus')">My Page 1</A></TD></TR><TR><TD ALIGN=CENTER><A HREF="java script:void(0)" onClick="LaunchPage('mypage2.html','fullscreen=no,location=no,menubar=no,toolbar=no,top=0,left=0,wid th=950,height=650,resizable=yes')">My Page 2</A></TD></TR></TABLE></BODY></HTML>If you click "My Page 1", the following file is open in a new window:*** mypage1.html ***<HTML><BODY>My Page 1</BODY></HTML>If you click "My Page 2", the following file is open in a new window:*** mypage2.html ***<HTML><BODY>My Page 2</BODY></HTML>Both Internet Explorer and Firefox create the mentioned pages according to the "props" parameter passed to function LaunchPage.However, the pages created by Google Chrome are off in regard to the width and height especified in the mentioned parameter.If you remove the comment from the statement alert(props) in function LaunchPage, save file "test.html" and load it again, you will notice that Google Chrome will launch pages mypage1 and mypage2 with the correct width and height, just like IE and Firefox.I would appreciate whether someone could provide any comments about this issue.Thank you in advance.paulo1Google Chrome version (38071)Internet Explorer version: 8.0.6001.18702Firefox version: Gecko/20100115 Firefox/3.6Operating System: Windows XP

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...