473,606 Members | 3,100 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(newu rl)
{
popupWin=window .open(newurl,'o pen_window','me nubar=no,toolba r=no,location,d irectories,stat us,
scrollbars,resi zable,dependent ,width=200,heig ht=300,left=0,t op=0')
}

Inside the HTML Body:

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

with regards
venkat.
Jul 20 '05 #1
2 4118
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(newu rl)
{
popupWin=window .open(newurl,'o pen_window','me nubar=no,toolba r=no,location,d irectories,stat us,
scrollbars,resi zable,dependent ,width=200,heig ht=300,left=0,t op=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_windo w",
"location,direc tories,status,s crollbars,resiz able,dependent, width=200,heigh t=300,left=0,to p=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="javasc ript: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_wi ndow"
onclick="newwin dow1(this.href) ; return false;" title="Clicking this link
will open another window (popup)">See my garden <img
src="http://www10.brinkster .com/doctorunclear/BrowserBugsSect ion/Opera7Bugs/Opera7BugDispla yInline.html"
style="width:25 px; height:25px; border:0px none;" alt="alt="Click ing 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*********@ya hoo.co.in> wrote in message
news:b2******** *************** ***@posting.goo gle.com...
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(newu rl)
{
popupWin=window .open(newurl,'o pen_window','me nubar=no,toolba r=no,location,d i
rectories,statu s, scrollbars,resi zable,dependent ,width=200,heig ht=300,left=0,t op=0')
}

Inside the HTML Body:

<a href="#" onclick="javasc ript: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
20534
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 with the above solution is the back/forward buttons and all the other browser options. Because of this, I am trying to get the following solution to work: <a href="#" onclick="popUp('./pdf.do?parameter=01121980')"><b>pdf</b></a>
10
11211
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="#" onClick="window.open('/cgi-bin/displayimage.cgi?/store/demo/image.jpg&YOUR+PRODUCT%27<b>S+NAME+GOES', 'fullimage', 'WIDTH=420,HEIGHT=405,status=0')"> The original window should not reload, but is, and I have tested it with both version 4.72 and 7.02, and they both do it. IE does not do it....
14
11062
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 window.open function? I would prefer not to create a separate HTML page. So far all I have is the basic var cwin = window.open('images/KJV-THANKS.gif', 'Thanks', 'width=243,height=420,'); cwin.focus();
14
2767
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. Here is the code, the functions are <script language="javascript"> function openwin(){ win_usr=window.open ("control_numinfo.aspx") } function closewin(){
2
2933
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 (keeping it on top). I have most of it working but I can't get it all working. I can either have the window open and disable the buttons with the new window in the background, or I can have the new window in the foreground but not be able to disable...
8
2479
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" type="text/javascript"> <!-- ; var newwindow = ''
5
3078
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 ideas?
4
6387
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 to look a and I am loosing tremendious amounts of time trying to organize it so that I could view it. Regards, Alexandre Brisebois
9
2577
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" runat="server"/> <asp:Label ID="CompanyPicture" runat="server"/> I have 2 links that open the windows to preview these images. The previewed images are done on separate html pages that do nothing but display the
0
8036
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8461
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8448
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8126
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
5987
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3948
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4010
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2454
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1313
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.