473,657 Members | 2,394 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

permission denied to set property window.onunload


Hey guys,

This error occurs ONLY in Netscape 7.0. Not in 7.1. So, I think it's a
bug. Buuuut...

Has anyone had this problem or know of a fix?

When attempting to have an onunload function set with "window.onload= ",
the error comes up
"permission denied to set property window.onunload "

I can't find a thing on this one. Setting it with the normal "<body
onunload" works fine. But isn't a great thing for me to do, since the
onload is part of a very large menu script.

Here's a test page to illustrate the problem. Netscape 7.0 has a problem
with this. 7.1 does not. IE is fine, too.

<html>
<head>
<title> New Document </title>
<script>
window.onunload ="alert('bye bye');"
</script>
</head>

<body>
test
</body>
</html>
-------------------------------------------------
~kaeli~
Jesus saves, Allah protects, and Cthulhu
thinks you'd make a nice sandwich.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
-------------------------------------------------
Jul 20 '05 #1
6 15892
kaeli wrote:
Hey guys,

This error occurs ONLY in Netscape 7.0. Not in 7.1. So, I think it's a
bug. Buuuut...

Has anyone had this problem or know of a fix?

When attempting to have an onunload function set with "window.onload= ",
the error comes up
"permission denied to set property window.onunload "

I can't find a thing on this one. Setting it with the normal "<body
onunload" works fine. But isn't a great thing for me to do, since the
onload is part of a very large menu script.

Here's a test page to illustrate the problem. Netscape 7.0 has a problem
with this. 7.1 does not. IE is fine, too.

<html>
<head>
<title> New Document </title>
<script>
window.onunload ="alert('bye bye');"
</script>
</head>

<body>
test
</body>
</html>


Don't assign a string as an event handler.

window.onunload = function() {
alert('bye, bye');
}

works, as would:

function myOnunload() {
alert('bye, bye');
}
window.onunload = myOnunload;

--
| 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 #2
In article <3F************ **@agricoreunit ed.com>,
gw*****@agricor eunited.com enlightened us with...
Don't assign a string as an event handler.

The original didn't.
This was just for testing.

You don't want to see the whole thing. :)

Here's the one line from the original source, in case it makes sense by
itself.

ScLdAgainWin.on unload=UnLoaded ;

(UnLoaded is a defined function - again, this code works fine in all
other target browsers, including IE5+, NN6.2, and NN7.1)

If you want the whole source, it's HVMenu from dynamicdrive.co m. I've
been using it for some time, but it was only tested up to NN6.2. I
checked for updates, but there were none. I may decide to contact the
author, but if this is a browser bug, I don't want to bother.

-------------------------------------------------
~kaeli~
Jesus saves, Allah protects, and Cthulhu
thinks you'd make a nice sandwich.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
-------------------------------------------------
Jul 20 '05 #3
"kaeli" <ti******@NOSPA M.comcast.net> wrote in message
news:MP******** *************** *@nntp.lucent.c om...
<snip>
ScLdAgainWin.on unload=UnLoaded ;

<snip>

Is this assigning a reference to a function defined in the current
window to a property of a pop-up?

Richard.
Jul 20 '05 #4
In article <bo************ *******@news.de mon.co.uk>,
Ri*****@litotes .demon.co.uk enlightened us with...
"kaeli" <ti******@NOSPA M.comcast.net> wrote in message
news:MP******** *************** *@nntp.lucent.c om...
<snip>
ScLdAgainWin.on unload=UnLoaded ;

<snip>

Is this assigning a reference to a function defined in the current
window to a property of a pop-up?


No, the code is running from a frameset. It is addressing the main
frame. That doesn't matter, though, since it doesn't work in a regular
page, either.

It doesn't work no matter where you put it, which was what I was showing
in the little test page I posted. It won't let you assign anything to
onunload with script, it has to be in the body tag. Again, this works in
every browser I need it to work in except NN7.0. NN7.1 it works fine.
NN7.0 throws a security exception.
-------------------------------------------------
~kaeli~
Jesus saves, Allah protects, and Cthulhu
thinks you'd make a nice sandwich.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
-------------------------------------------------
Jul 20 '05 #5
"kaeli" <ti******@NOSPA M.comcast.net> wrote in message
news:MP******** *************** *@nntp.lucent.c om...
<snip>
It doesn't work no matter where you put it, which was what I
was showing in the little test page I posted. It won't let
you assign anything to onunload with script, it has to be in
the body tag.


As Grant said, your original test page wasn't going to work because it
was assigning a string instead of a function. But testing:-

<html>
<head>
<title></title>
<script>
function UnLoaded(){aler t('bye bye');}
window.onunload =UnLoaded;
</script>
</head>
<body>
test
</body>
</html>

- worked with (Windows) Netscape 7.00 & 7.02 both from the local file
system and over an HTTP server.

If all else fails, have you considered branching on
window.addEvent Listener and using that for onunload if available?

Richard.
Jul 20 '05 #6
In article <bo************ *******@news.de mon.co.uk>,
Ri*****@litotes .demon.co.uk enlightened us with...

As Grant said, your original test page wasn't going to work because it
was assigning a string instead of a function. But testing:-

<html>
<head>
<title></title>
<script>
function UnLoaded(){aler t('bye bye');}
window.onunload =UnLoaded;
</script>
</head>
<body>
test
</body>
</html>

- worked with (Windows) Netscape 7.00 & 7.02 both from the local file
system and over an HTTP server.

Not on ours.
I have 2 users who test for me, and they have 7.0, and this gave the
same error.

I wonder if it's something in their settings...
Neither has a user.js file that I could find. I know people can turn off
onunload with a setting in that file, but neither of them have that.
If all else fails, have you considered branching on
window.addEvent Listener and using that for onunload if available?


I already did a workaround, but it was icky. I put the function call in
the onunload event of each body tag of every damn page (thank goodness
for dreamweaver templates!).

addeventlistene r for onunload did the same error for their browsers.

This wouldn't be that big of a deal if we didn't have a ton of Netscape
users. *sigh*

-------------------------------------------------
~kaeli~
Jesus saves, Allah protects, and Cthulhu
thinks you'd make a nice sandwich.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
-------------------------------------------------
Jul 20 '05 #7

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

Similar topics

3
41404
by: Robert Mark Bram | last post by:
Hi All! I have a piece of JavaScript that attempts to find the location.href property of another window. For example: contentWindow = window.open('', 'someWindowName'); var otherUrl = contentWindow.location.href; If it happens to find a window named 'someWindowName' that currently has a
6
4066
by: Adrian Parker | last post by:
Using asp.net 2003 When I use document.attachEvent("onmousemove", resetTimer); The first time into a page, it works fine, but the 2nd time the page is loaded (not postback) it gives a permission denied error.. any ideas why ? Thanks
21
18161
by: alistair_henderson | last post by:
Morning All, I have some code for a website which uses 'window.open' to simulate modal dialog boxes. I use the window.closed property to decide if the window object exists at various points. This has been fine until last week when I started getting javascript 'Permission Denied' errors when I try to access this property. I suspect that a windows update has caused this somehow, as this code has not changed for a very long time. Can...
4
3452
by: MrGado | last post by:
Running on Windows XP with Mozilla 2.0.0.4, I am experiencing a strange security issue. function loadXMLDoc(url,funcname) { try { netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); } catch (e) { alert("Permission UniversalBrowserRead denied.");
0
8420
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
8324
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8740
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...
0
8617
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7353
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5642
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
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
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1733
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.