473,545 Members | 2,413 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 10165
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
1997
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
9444
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
7083
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
3525
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
7420
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7446
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
7778
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...
1
5349
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...
0
3476
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...
0
3459
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1908
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
1033
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
731
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...

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.