473,574 Members | 2,861 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

suppress script errors

window.onerror is used to catch and supress the script error. but it
will catch the error only when the script is within the same source

for example, consider a html file MainFrame.htm as,

<IFRAME src="ScriptErro r.jsp" id="controllerF rame"
name="controlle rFrame" height=150 width="450"
<DIV id=oErrorLog style="border:1 px groove orange
;width:450px;he ight:200px; "></DIv>
var frm=document.fr ames;
window.onerror= fnErrorTrap;
oErrorLog.inner HTML=frm(1).nam e;
function fnErrorTrap(sMs g,sUrl,sLine){
oErrorLog.inner HTML="<b>An error was thrown and caught. </b><p>";
oErrorLog.inner HTML+="Error: " + sMsg + "<br>";
oErrorLog.inner HTML+="Line: " + sLine + "<br>";
oErrorLog.inner HTML+="URL: " + sUrl + "<br>";
return true;

ScriptError.jsp is as:

<INPUT TYPE="text" ID=oErrorCode VALUE="someObje ct.someProperty =true;">
document.write( eval(oErrorCode .value));

in the script of MainFrame.htm, frm(1) is null object and the error is
catched and suppressed, but the file scriptError.jsp also has the
script errror. what i need is to catch the error in scriptError.jsp
also from the MainFrame.htm, is it possible to catch the error?

Jul 23 '05 #1
1 2711
"suganya" wrote
window.onerror is used to catch and supress the script error. but it
will catch the error only when the script is within the same source
file. <snip> window.onerror= fnErrorTrap;

You could add a line like this:

window.frames[yourframename].onerror=fnErro rTrap;

before or after the content of the frame has been written, you 'll need to
experiment with that..
Or add a error trapping function in your document.write statement.

Jul 23 '05 #2

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

Similar topics

by: lawrence | last post by:
This line: if (file_exists($fileName)) { is (on some web servers) giving me this kind of error: Warning: SAFE MODE Restriction in effect. The script whose uid is 1022 is not allowed to access /home/www owned by uid 0 in
by: Krishna Srinivasan | last post by:
I have a form with check boxes. When accessing a check box element that is not checked, I get a notice (Notice: Undefined variable..). Is there a way to hide these notices and warning in PHP code without having to modify the PHP.ini file? Krishna Srinivasan.
by: Uttam | last post by:
Hello, How does one suppress the "Object already exists" message when the following statement is executed in ADO? cat.Views.Append "Some_Query", cmd Thanks in advance. Uttam
by: teddysnips | last post by:
I posted yesterday about a project I'm involved in to build a login application using a barcode scanner. I've solved most of the problems, but one remains. The client want to disable keyboard input (except at some remote sites where there won't be a scanner). The session "knows" whether that site should be keyboard enabled, but...
by: Ron St-Pierre | last post by:
Whenever I run certain functions, such as the example below, the output is either displayed in the terminal or emailed to be by cron, depending on how I run it. Is there any way I can re-write the function, set some psql parameters, etc, to ensure that the results aren't displayed? I've checked some of the postgresql.conf logging properties...
by: Ron St-Pierre | last post by:
Is there a way 'within' psql to suppress output? One of our cron scripts calls a sql file which contains various database commands (ALTER TABLEs, UPDATEs, etc) and various user-defined functions. So within this sql file there are various SELECT * FROM myFunction(); which sends output to the user from cron. I can't see anyway to suppress this...
by: ZeeHseez | last post by:
Hi, I have written a webbrowser application in VB .net Framework 1.1. I would like to suppress javascript error messages. However, the silent property of the webbrowser control suppresses the Javascript messages, but it also blocks any other dialog box, such as Login dialog, i can't use the silent property. I used...
by: Evert | last post by:
Hi all! I have a script that queries a whole bunch of clients for a specific value. Some of the clients do not repond properly, and then I end up with lines like: Warning: snmpget(): Error in packet: (noSuchName) There is no such variable name in this MIB. in /usr/local/sbin/signal_new.php on line 36
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. ...
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...
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...
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...
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...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
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.