Wrox Programmer Forums
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 14th, 2003, 09:36 AM
Authorized User
 
Join Date: Aug 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default onerror

Hi All

    could you please tell me why the following script does not fire on my machine . the body of "tellerror" function does not fired at all but the error message suppressed . it suppose to be fired because I created an element on a page on different domain in onload event and if I remove window.onerror then I'll get an access denied error .

<head>
<script language="JavaScript">
function tellerror(){
alert('An error has occurred!') ;
return true ;
}
window.onerror=tellerror

</script>

</head>

<body onload="window.document.frames['frame1'].document.createElement('SPAN');">
   <iframe id="frame1" src="http://www.msn.com/" width="100%" height="100%" >
</body>




 
Old October 15th, 2003, 04:29 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Works as expected for me with exactly the same code.

--

Joe
 
Old October 15th, 2003, 06:21 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi alihussein3,

Are you using a product like Norton Internet Security or some other Ad blocking software? These programs add their own error stuff to the page, to prevent errors from missing ad stuff. For example, NIS adds this:

window.onerror = SymError;

If you have that on your page, your custom error handler may have been overwritten.....


Cheers,
Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange Problem - Application OnError r_ganesh76 VS.NET 2002/2003 5 June 4th, 2005 02:31 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.