In my c# program ive got a WebBrowser control in which a certain
website is called.
This website gives for some reason a javascript errors (message box)
from time to time. Is there a way to build my program so that the
javascript errors dont appear ?
i search many article but i don't solve
i'm try next
private void axWebBrowser1_DocumentComplete(object sender,
AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent e)
{
// excute javascript error
SHDocVw.WebBrowser b = (WebBrowser)e.pDisp;
mshtml.HTMLDocumentClass c =
(HTMLDocumentClass)b.Document;
mshtml.HTMLWindow2Class w =
(HTMLWindow2Class)c.parentWindow;
try
{
w.HTMLWindowEvents2_Event_onerror +=new
HTMLWindowEvents2_onerrorEventHandler(w_HTMLWindow Events2_Event_onerror);
m_ScriptErrorHandleTable.Add(e.uRL, w);
}
catch(Exception e10)
{
SSTrace.Trace( e10 );
}
}
private void w_HTMLWindowEvents2_Event_onerror(string description,
string url, int line)
{
try
{
HTMLWindow2Class w =
(HTMLWindow2Class)m_ScriptErrorHandleTable[url];
w.@event.returnValue = true;
}
catch(Exception ex)
{
Console.WriteLine(ex.Message);
}
}
this is half success. several frames web page is not work well on
javascript error
i do too
http://support.microsoft.com/default.aspx?scid=kb;en-us;261003
public int Exec( ref Guid pguidCmdGroup, int nCmdID, int nCmdexecopt,
object[] pvaIn, object[] pvaOut )
{
switch( nCmdID )
{
case (int)OLECMDID.OLECMDID_SHOWSCRIPTERROR:
// how do program this
break;
}
}
OLECMDID_SHOWSCRIPTERROR event is not fire
anyone help me.. thank you
ps) i'm not american. so my english expression is poor.. understanding
me