You can catch it with the message callback system. Something like this:
function myfunc(app,message){
var s = message + "" // BE SURE TO DO THIS!
if (s.indexOf("ERROR")>=0 && s.indexOf("load >>") >= 0) {
jmolScript("zap")
}
}
jmolSetCallback("messageCallback", "myfunc")
the message is in the second parameter and looks something like this:
script ERROR: Unexpected end of file after line 3:
x
for file
file:/C:/jmol-dev/workspace/Jmol-documentation/script_documentation/examples-11/t.xyz
type xyz
----line 1 command 1 of file null: load >> "t.xyz" <
You can't prevent it from showing, though, only act on it.
Bob
»»»JIJI«««.::::: wrote:
> Dear All,
>
> In jmol, if user upload any other format, which it cant show.
>
> then in the viewer it is showing error in red line at the top.
>
> so is their any option to catch the error in javascript...before it
> show the error applet.
>
> Regards,
>
> Jiji Tk
>
>------------------------------------------------------------------------
>
>-------------------------------------------------------------------------
>This SF.net email is sponsored by: Microsoft
>Defy all challenges. Microsoft(R) Visual Studio 2008.
>http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Jmol-developers mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/jmol-developers
>
>
--
Robert M. Hanson
Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr
If nature does not answer first what we want,
it is better to take what answer we get.
-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers