473,574 Members | 3,129 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

window.open does not work?

Hi,

I've just installed Netscape 7.1 for Linux and the following script
refuses to open a window when I call this function:

function OpenLinkWindow( ) {

wMap=window.ope n('http://naxos.orangepor t.net/cyclades-info/ShowMap.php?id_ advert=45&map=' ,'','width=400, height=600');
wMap.onResize =
'self.location. href=http://naxos.orangepor t.net/cyclades-info/ShowMap.php?id_ advert=45&map='
wMap.focus();
self.close();
}

In other browsers (NS 7.0/Win98, IE6/Win98) and in Netscape 7.0 for
Linux, it works fine.

What has changed in 7.1?????
Rgds,
Edwin

Jul 20 '05 #1
3 10167
DU
Edwin Boersma wrote:
Hi,

I've just installed Netscape 7.1 for Linux and the following script
refuses to open a window when I call this function:

function OpenLinkWindow( ) {

wMap=window.ope n('http://naxos.orangepor t.net/cyclades-info/ShowMap.php?id_ advert=45&map=' ,'','width=400, height=600');

One of the top most frequent validation errors is to forget to escape
ampersands in url strings.

B.2.2 Ampersands in URI attribute values
http://www.w3.org/TR/html401/appendi...s.html#h-B.2.2

Common Validation Problems:
Ampersands (&'s) in URLs
http://www.htmlhelp.org/tools/valida...blems.html#amp

height=600 will overflow the availHeight value on most scr. res.
(800x600, even 1024x768 ones) and will therefore trigger error
correction mechanisms to adjust the window size. Cpu, time, RAM will
unneedlessly be involved to reduce this 600px height to something shorter.
As coded, the window will not be resizable, will not have scrollbars if
he content overflows the actual, real window dimensions and will not
have status bar. Preventing resizing the window and removing scrollbars
when they are needed is counter-accessibility and anti-usability: they
both go against the best and most objective interests of the user and
the author; therefore this can not be recommendable.
wMap.onResize =
'self.location. href=http://naxos.orangepor t.net/cyclades-info/ShowMap.php?id_ advert=45&map='
Not an event handler at all here. No function call; just an url.

wMap.focus();
Illogical.
self.close();
A window not opened by javascript can NOT be closed by javascript. So
the opener here must have been opened by javascript otherwise this
instruction will not be honored in NS 7.1 and will generate a security
warning in the javascript console.
}

In other browsers (NS 7.0/Win98, IE6/Win98) and in Netscape 7.0 for
Linux, it works fine.

What has changed in 7.1?????
Rgds,
Edwin


<script type="text/javascript">
var WindowObjectRef erence; // needs to be global
function OpenLinkWindow( )
{
if(WindowObject Reference == null || WindowObjectRef erence.closed)
{
WindowObjectRef erence =
window.open("ht tp://naxos.orangepor t.net/cyclades-info/ShowMap.php?id_ advert=45&amp;m ap=",
"RequestedPopup "',
"top=50,left=10 0,width=400,hei ght=400,resizab le=yes,scrollba rs=yes,status=y es");

}
else
{
WindowObjectRef erence.focus();
};
}
</script>

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

Example of re-using a requested popup window (all according to
accessibility and usability guidelines):
http://www10.brinkster.com/doctorunc...pera7Bugs.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
Edwin Boersma wrote:
Hi,

I've just installed Netscape 7.1 for Linux and the following script
refuses to open a window when I call this function:

function OpenLinkWindow( ) {

wMap=window.ope n('http://naxos.orangepor t.net/cyclades-info/ShowMap.php?id_ advert=45&map=' ,'','width=400, height=600');
wMap.onResize =
'self.location. href=http://naxos.orangepor t.net/cyclades-info/ShowMap.php?id_ advert=45&map='
wMap.focus();
self.close();
}

In other browsers (NS 7.0/Win98, IE6/Win98) and in Netscape 7.0 for
Linux, it works fine.

What has changed in 7.1?????

Rgds,
Edwin


I doubt very much it "works fine" in any browser. Events are all lower case in JavaScript, so wMap.onResize is simply
creating a new property and assigning your string value to it.

Even if you wrote:

wMap.onresize = 'whatever';

you're still assigning a string to the event, and you need to be assigning a function.

Maybe you meant:

wMap.onresize = function() {
self.location.h ref =
'http://naxos.orangepor t.net/cyclades-info/ShowMap.php?id_ advert=45&map=' ;
}

?

However, even assuming you got the syntax for assigning the onresize event correct, there's still the matter that you are
potentially assigning wMap.onresize before it's content has even finished loading, at which point the <body ...
onresize="..."> event (if any) would overwrite your assignment. If there is no onresize event for the content you are
loading, then most likely your carefully crafted onresize event is simply being replaced by null.

If any of what you had above was working in any browser, then it was a bug in /that/ browser, not the current one.

--
| Grant Wagner <gw*****@agrico reunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
* http://devedge.netscape.com/library/...ce/frames.html
* Internet Explorer DOM Reference available at:
* http://msdn.microsoft.com/workshop/a...ence_entry.asp
* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html
Jul 20 '05 #3
DU
Grant Wagner wrote:
Edwin Boersma wrote:

Hi,

I've just installed Netscape 7.1 for Linux and the following script
refuses to open a window when I call this function:

function OpenLinkWindow( ) {

wMap=window.o pen('http://naxos.orangepor t.net/cyclades-info/ShowMap.php?id_ advert=45&map=' ,'','width=400, height=600');
wMap.onResize =
'self.locatio n.href=http://naxos.orangepor t.net/cyclades-info/ShowMap.php?id_ advert=45&map='
wMap.focus();
self.close();
}

In other browsers (NS 7.0/Win98, IE6/Win98) and in Netscape 7.0 for
Linux, it works fine.

What has changed in 7.1?????

Rgds,
Edwin

I doubt very much it "works fine" in any browser. Events are all lower case in JavaScript, so wMap.onResize is simply
creating a new property and assigning your string value to it.

Even if you wrote:

wMap.onresize = 'whatever';

you're still assigning a string to the event, and you need to be assigning a function.


Exactly.
Maybe you meant:

wMap.onresize = function() {
self.location.h ref =
'http://naxos.orangepor t.net/cyclades-info/ShowMap.php?id_ advert=45&map=' ;
}

?

However, even assuming you got the syntax for assigning the onresize event correct, there's still the matter that you are
potentially assigning wMap.onresize before it's content has even finished loading, at which point the <body ...
onresize="..."> event (if any) would overwrite your assignment. If there is no onresize event for the content you are
loading, then most likely your carefully crafted onresize event is simply being replaced by null.

<body onresize="..."> is not HTML 4 valid anyway. AFAIK, only the
document and the window objects can have a resize event listener.

The OP's code is still nebulous, counter-productive and confusing. If an
resize event is triggered, then he wants to load the resource in the
opener, give focus to the popup and then close the opener.
If any of what you had above was working in any browser, then it was a bug in /that/ browser, not the current one.

--
| Grant Wagner <gw*****@agrico reunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
* http://devedge.netscape.com/library/...ce/frames.html
* Internet Explorer DOM Reference available at:
* http://msdn.microsoft.com/workshop/a...ence_entry.asp
* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.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 #4

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

Similar topics

3
2002
by: kaith | last post by:
The following code used to popup a window when I used netscape 4.79. Now I switched to mozilla 1.4 and the window doesn't popup. function newWindow(newContent) { winContent =window.open(newContent,'nextWin','screenX=0,screenY=20,width=600....); winContent.focus(); } ....
18
9451
by: Wladimir Borsov | last post by:
Inside a html page (more precicesly inside a JSP page) I defined a button. When the user clicks this button a second browser window should pop up und load the passed URL. I coded <img src="mybutton.gif" onclick='window.open("http://mydomain.com", "Mytitle);'> However when I click on the button (under Win2000 + IE5.5) no window pops up. ...
5
7088
by: Jorn TK | last post by:
Hi, i use window.open to display the result of polls window.open('../poll.php?schid=".$schid."&permit=1&pollid=".$dbpoll."&answ='+opt,'','menubar=no,width=250,height=230'); it work fine in IE but does not work with firefox, is there error in the code? Thanks & Regards
13
3535
by: Bob Jones | last post by:
Here is my situation: I have an aspx file stored in a resource file. All of the C# code is written inline via <script runat="server"tags. Let's call this page B. I also have page A that contains some javascript code that calls window.open. I pass the resource url of page B to Page A's window.open call. Page B is then loaded and executed but...
0
7837
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...
0
8097
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. ...
1
7852
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...
0
8133
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6504
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5333
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3791
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2268
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
1
1366
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.