473,583 Members | 3,156 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Flanagan onerror example does not work for me

I am working my way through David Flanagan's Definitive Guide to Javascript.
Example 14-1 has an onerror event handler and includes a deliberate error as
a test. Problem is my browser's javascript default error handler intervenes
and controls the error handling and the handler in the example is not
called.
Disabling the browser's script debugging does not help - presumably it
prevents the error being passed to the handler?
I would be grateful if someone could explain what is going on here and how I
can get this example to run.
My browser is IE 6.0.2800.1106
Jul 20 '05 #1
2 2153
On Thu, 15 Jan 2004 12:46:31 +1300, "Alliss" <al****@wonderl and.com>
wrote:
I am working my way through David Flanagan's Definitive Guide to Javascript.
Example 14-1 has an onerror event handler and includes a deliberate error as
a test. Problem is my browser's javascript default error handler intervenes
and controls the error handling and the handler in the example is not
called.
Which edition, the 4th is good, but does still contain old examples
from the not so good previous books. onerror is generally best
avoided as it doesn't catch many errors anyway!
I would be grateful if someone could explain what is going on here and how I
can get this example to run.
My browser is IE 6.0.2800.1106


it may be rewrite your browser!

Look for object detection techniques, but give them more weight than
Flanagan does there.

Jim.
--
comp.lang.javas cript FAQ - http://jibbering.com/faq/

Jul 20 '05 #2

"Jim Ley" <ji*@jibbering. com> wrote in message
news:40******** *******@news.ci s.dfn.de...
On Thu, 15 Jan 2004 12:46:31 +1300, "Alliss" <al****@wonderl and.com>
wrote:
I am working my way through David Flanagan's Definitive Guide to
Javascript.
Which edition, the 4th is good, but does still contain old examples
from the not so good previous books. onerror is generally best
avoided as it doesn't catch many errors anyway!


Thanks Jim. It is the 4th edition. The example used an error handler to
demonstrate dynamically generated html rather than error handling as such,
so I will press on and not let it sidetrack me.

Allis

Jul 20 '05 #3

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

Similar topics

2
6118
by: Robert Oschler | last post by:
If I set window.onerror to an error handler I've created, I don't see the browser error dialogs anymore but I don't see the alert() messages in my error handler pop up either. Can someone tell me what I am doing wrong? Here's the test doc I'm using: =========== BEGIN TEST DOC =================== <HTML> <TITLE> OnError Test </TITLE>...
4
8929
by: Jürgen Heyn | last post by:
Good afternoon, I am handing a string as a parameter pImage = "Images/Available.jpg" If this image is NOT available I would like to load Images/NoImage.jpg. Unfortunately the following code does NOT work. obj.write('<p><img src=' + pImage + ' onError="self.src="Images/NoImage.jpg"" border="0"></p>'); Where is my mistake ? I appreciate...
1
6154
by: bjarthur | last post by:
i have (see below) what i think is a fairly simple algorithm, but yet it doesn't work. given a directory with consecutively numbered jpeg files (1.jpg, 2.jpg, 3.jpg...), it is designed to count how many files there are using a binary search. it uses the onload and onerror event handlers of the image object to see if the files successfully...
2
4120
by: Tee | last post by:
what's the differences between "Overrides Sub OnError" and "Sub Page_Error" ?
3
2229
by: Tobius | last post by:
I want to be able to define a custom onerror event that detects an attempt to call a known function and load a file if it's not already loaded and re-call the function. The only problem is that any triggering of the onerror event stops execution of the script block in question. Is there a workaround for this? Here's an example of what I'm...
2
13742
by: crazydave | last post by:
Hi, I've been using window.onerror to capture and report JavaScript errors from other users for debugging an application I've written. But I've run into a strange issue with Firefox and window.onerror. It seems that any code that executes, having originated from an "element.addEventListener", causing an error does not activate...
5
2918
by: Pete Verdon | last post by:
I'm working on a fairly sizeable javascript application. I recently added some error-handling to it, using window.onerror to catch them. This sometimes works and sometimes doesn't; if I introduce a deliberate mistake "near the top" of the system then it's trapped and handled properly, but there's lots of code where mistakes only show up in my...
4
3884
by: josh | last post by:
Hi if I try to attach onerror event via addEventListener window.addEventListener("error", myError, false) it does not work as it pass to myError only the event object but not the three parameters error message, url, line number as in: window.onerror = myError infact if I assing it via window.onerror = myError it works!
0
8186
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. ...
0
8329
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...
1
7936
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
6583
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...
1
5704
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
5377
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
3847
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1436
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1160
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.