script error

  • Thread starter Thread starter Tam Inglis
  • Start date Start date
T

Tam Inglis

I have a web browser contol working sweetly.

However when it hits a page with java script that has an error it throws up
a dialog box each time prompting me "Do you wish to continue running scripts
on this page"

How can i supress this message... its gotta be something simple and ive been
hunting for the answer for ages... any help appreciated.

Tam
 
Tam Inglis said:
I have a web browser contol working sweetly.

However when it hits a page with java script that has an error it throws up
a dialog box each time prompting me "Do you wish to continue running scripts
on this page"

How can i supress this message... its gotta be something simple and ive been
hunting for the answer for ages... any help appreciated.

Tam

Can i be rude and pop another question...

Both of these statements cause the dialog box to show. any thoughts as to
why?

myWebDoc.execCommand("SaveAs",false,"C:\temp.jpg");
myWebDoc.execCommand("SaveAs",true,"C:\temp.jpg");
 
about the only thing you can do is map the windows.onerror event to a
routine which basically will return a null to suppress the event bubble up
the call stack. I'm not a big fan of that approach either because what you
are doing is essentially surpressing the error detection and reporting
mechanism. For example, it would suppress the script error but it will also
suppress a critical null object error which you might want to catch and fix.
Anyway the script syntax would be put in something like your window_onload
routine where you say window.onerror = myfunction
 
Ah. I dont create the script :-( The application will be surfing to unkown
sites and kinda must be able to handle this.

Basically it can come from anywhere... just need to prevent that dialog box
popping up. InternetExplorer doesnt and i was under the impression that it
used the same settings.
 
Tam Inglis said:
Both of these statements cause the [error] dialog box
to show. any thoughts as to why?

myWebDoc.execCommand("SaveAs",false,"C:\temp.jpg");
myWebDoc.execCommand("SaveAs",true,"C:\temp.jpg");

'\t' is probably being interpreted as a tab character.

Try "C:\\temp.jpg" or @"C:\temp.jpg" instead.

P.
 
thanks to both who replied.

sorry, should have been clearer. that was a paste from the debugger, the c#
statement is indeed already escaped as you suggested.

However. I found an old visual basic reference that basically said that the
path argument is ignored when used in this manner with ExecWB. Security
policy denies it as it would mean any webpage could upload thousands of
files to your machine. So no matter what you specify it simply ignores it.

Would seem to be the case, as no matter the path specified, it always
defaults to MyPictures.

There must be a way of extracting the image though. Either from the webpage
itself where i beleive it is a metafile or from the cache. Bit of a pain
though as this is unexplored territory for me.

Maybe thats a good thing though ;-) Nothing like being forced to learn.
hehe.

Paul E Collins said:
Tam Inglis said:
Both of these statements cause the [error] dialog box
to show. any thoughts as to why?

myWebDoc.execCommand("SaveAs",false,"C:\temp.jpg");
myWebDoc.execCommand("SaveAs",true,"C:\temp.jpg");

'\t' is probably being interpreted as a tab character.

Try "C:\\temp.jpg" or @"C:\temp.jpg" instead.

P.
 
Back
Top