Connecting Tech Pros Worldwide Help | Site Map

window.open not working in IE5

  #1  
Old July 20th, 2005, 12:24 PM
venkatesh
Guest
 
Posts: n/a
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.
  #2  
Old July 20th, 2005, 12:24 PM
DU
Guest
 
Posts: n/a

re: window.open not working in IE5


venkatesh wrote:[color=blue]
> 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')[/color]

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.
[color=blue]
> }
>
> Inside the HTML Body:
>
> <a href="#" onclick="javascript:newwindow('new.html');"
> class=lin>CLICK HERE a></P>[/color]

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

  #3  
Old July 20th, 2005, 12:24 PM
Stuart Palmer
Guest
 
Posts: n/a

re: window.open not working in IE5


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" <venkat2k_vb@yahoo.co.in> wrote in message
news:b259f1ac.0310272334.230855a9@posting.google.c om...[color=blue]
> 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)
> {
>[/color]
popupWin=window.open(newurl,'open_window','menubar =no,toolbar=no,location,di
rectories,status,[color=blue]
> 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.[/color]


Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
focus() not working in IE when created by appendChild joecap5 answers 4 September 11th, 2007 09:52 AM
Resize window not working in IE5.0 RJN answers 0 November 18th, 2005 07:43 PM
Resize window not working in IE5.0 RJN answers 0 November 18th, 2005 07:38 PM
close() not working in Mac IE 5.2 Alan Little answers 2 July 23rd, 2005 02:24 PM