hi i have a asp.net page where i am trying to use a window.onerror
property. I am using a dinky variable which is undefined in a alert
statement The whole code works fine the way it is supposed if i put it
in a simple html page but if i put the same code in an asp.net page it
stops working. I got this code from jave the definitive guide(PS: i
have already changed self.onerror to window.onerror, before this change
it was not even working on a html page i am using IE6)
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs"
AutoEventWireup="false" Inherits="javascript.WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
<title>WebForm1</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/ie5">
<script lang=javascript>
// A variable we use to ensure that each error window we create is
unique
var error_count = 0;
// Set this variable to your email address
var email = "my****@mydomain.com";
// Define the error handler. It generates an HTML form so the user
// can report the error to the author.
function report_error(msg, url, line)
{
//function code
return true;
}
// Before the event handler can take effect, we have to register it
// for a particular window
window.onerror = report_error;
</script>
</head>
<body MS_POSITIONING="GridLayout">
<form id=form1 method="post" runat="server">
<script language=javascript>
// The following line of code purposely causes an error as a test
alert(dinky);
//dinky is undefined to cause an error
</script>
</form>
</body>
</html>