473,387 Members | 1,572 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

window.open not working in IE5

Hi Members,

I have used the below mentioned code to open a html page in a new
browser. The window size is 200 x 300. In that browser, I've given
code to open another browser of the same size. However, this is not
happening in IE 5. Can anyone help me solve this problem?

Code:

Script:
function newwindow1(newurl)
{
popupWin=window.open(newurl,'open_window','menubar =no,toolbar=no,location,directories,status,
scrollbars,resizable,dependent,width=200,height=30 0,left=0,top=0')
}

Inside the HTML Body:

<a href="#" onclick="javascript:newwindow('new.html');"
class=lin>CLICK HERE a></P>

with regards
venkat.
Jul 20 '05 #1
2 4089
DU
venkatesh wrote:
Hi Members,

I have used the below mentioned code to open a html page in a new
browser. The window size is 200 x 300. In that browser, I've given
code to open another browser of the same size. However, this is not
happening in IE 5. Can anyone help me solve this problem?

Code:

Script:
function newwindow1(newurl)
{
popupWin=window.open(newurl,'open_window','menubar =no,toolbar=no,location,directories,status,
scrollbars,resizable,dependent,width=200,height=30 0,left=0,top=0')
1- dependent is only supported in NS 4+ and in Mozilla-based browsers
2- you can make the windowFeatures string list more compact like this:

popupWin=window.open(newurl, "open_window",
"location,directories,status,scrollbars,resizable, dependent,width=200,height=300,left=0,top=0");
Once a single window feature has been defined, all others which are not
defined are turn off.
}

Inside the HTML Body:

<a href="#" onclick="javascript:newwindow('new.html');"
class=lin>CLICK HERE a></P>


Not good.
1- If javascript is disabled or not supported, the requested popup
window will not be opened when it should. 8% to 12% of users surf with
javascript support disabled or with a browser without javascript.
2- The popup might open but then the default action of the link is not
cancelled: the opener is scrolled all the way back to the top after the
opening of the window.
3- The "javascript:" part in the onclick event handler is pointless,
unneeded. You may declare in the <head> section
<meta http-equiv="Content-Script-Type" content="text/javascript">
to declare the default scripting language in your document:
http://www.w3.org/TR/html401/interac...default-script
4- the class attribute value should be quoted
5- Absolutely avoid "Click here" link labels. Use a descriptive label:
http://www.w3.org/QA/Tips/
Don't use "click here" as link text:
http://www.w3.org/QA/Tips/noClickHere
6- newwindow is called but only newwindow1 is declared and defined. That
was probably why you thought window.open was not working.

So:
<p><a href="new.html" target="open_window"
onclick="newwindow1(this.href); return false;" title="Clicking this link
will open another window (popup)">See my garden <img
src="http://www10.brinkster.com/doctorunclear/BrowserBugsSection/Opera7Bugs/Opera7BugDisplayInline.html"
style="width:25px; height:25px; border:0px none;" alt="alt="Clicking the
link will create a new window (popup)"></a></p>

The code could be further improved to make the requested popup recycling
referenced, targeted resources. Only 1 popup opened at a time for
possibly several links.
Also, the code could be improved so that if the popup loses focus, it
can be brought back by clicking the opener's link. Right now, as coded,
the newwindow1 function does not do that... and this is known to be a
very frequent usability problem, confusion factor for users.

Open a link in a new window: when and how can that setting affect my
surfing?
http://www10.brinkster.com/doctorunc...nLinkNewWindow

Examples of use of recycling resources with/for a single popup:

http://www10.brinkster.com/doctorunc...pera7Bugs.html

http://www10.brinkster.com/doctorunc...Thumbnail.html

DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/
- Resources, help and tips for Netscape 7.x users and Composer
- Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
http://www10.brinkster.com/doctorunc...e7Section.html

Jul 20 '05 #2
Your function being called has a different name to the function (newwindow1
and newwindow), remove the 1 in the funciton name. I have ie 5.5 and it
works for me.

Hope that helps

Stu

"venkatesh" <ve*********@yahoo.co.in> wrote in message
news:b2**************************@posting.google.c om...
Hi Members,

I have used the below mentioned code to open a html page in a new
browser. The window size is 200 x 300. In that browser, I've given
code to open another browser of the same size. However, this is not
happening in IE 5. Can anyone help me solve this problem?

Code:

Script:
function newwindow1(newurl)
{
popupWin=window.open(newurl,'open_window','menubar =no,toolbar=no,location,di
rectories,status, scrollbars,resizable,dependent,width=200,height=30 0,left=0,top=0')
}

Inside the HTML Body:

<a href="#" onclick="javascript:newwindow('new.html');"
class=lin>CLICK HERE a></P>

with regards
venkat.

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Michael | last post by:
I am trying to allow a user to view a PDF in a new window. I currently have this working using the following: <a href="./pdf.do?parameter=01121980" target="top"><b>pdf</b></a> The problem...
10
by: Marshall Dudley | last post by:
When I do the following line in Netscape, the popup loads as it should, but the parent window usually, but not always, reloads as well. <a href="#"...
14
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a...
14
by: Paul | last post by:
Hi I have 2 functions in java script, one opens a second window-this works, the other is supposed to close this second window, does not seem to be working. Just wondering if anyone had any ideas....
2
by: carlor | last post by:
Hi there, I have a form that contains a link button. When the user clicks the link button I need to enable a couple of other buttons on the page and open a new browser window giving it focus...
8
by: johnsonholding | last post by:
Here is the code for a pop-up window that works in Firefox and not in IE - I get a java error or something, Here is the code : </script> <SCRIPT language="JavaScript"...
5
by: lindanr | last post by:
In ASP.NET 2005 I have an onblur="window.close()" javascript event in the <body> tag. When I click on the window's scrollbar, the window closes. The same code works fine in ASP.NET 2003. Any...
4
by: alexandre.brisebois | last post by:
Hi, I am using access 2003, I would like to know if there is an option to reorganize the tables in a maner that is readable, as we can do in sql sever 2000 or 2005. I have been given a database...
9
by: tshad | last post by:
This was posted before but the message got messed up (all NLs were stripped out for some reason). I have 2 labels that hold the name of different images on my .aspx page. <asp:Label ID="Logo"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.