Jmol/debugging: Difference between revisions

Eric Martz (talk | contribs)
Eric Martz (talk | contribs)
Line 15: Line 15:


== Techniques specific to JSmol run in a browser ==
== Techniques specific to JSmol run in a browser ==
When JSmol is running in a browser, bugs can occur either in the browser javascript that sends commands to JSmol, or in the JSmol commands themselves. To look for bugs in javascript, open the browser's console. For example, in Firefox: Tools, Web Developer, Browser Console.


You can use the JSmol Console to query variable values as
To open the JSmol Console: Right click in JSmol so that the menu appears, and then click on Console.
 
You can use the JSmol Console to query variable values:
 
<nowiki>print [jmol-expression]</nowiki>
 
or


  <nowiki>javascript alert(javascript-expression)</nowiki>
  <nowiki>javascript alert(javascript-expression)</nowiki>


<!-- I don't think this makes any sense because if you are in the JSmol Console, you can use the
above 'print' command. -Eric Martz 4/12/2021
or
or


  <nowiki>javascript alert(jmolEvaluate(jmol-expression))</nowiki>
  <nowiki>javascript alert(jmolEvaluate(jmol-expression))</nowiki> -->


== Acknowledgements ==
== Acknowledgements ==


Some of these techniques were suggested by [https://sourceforge.net/p/jmol/mailman/message/37260020/ Bob Hanson] and [https://sourceforge.net/p/jmol/mailman/message/37259976/ Eric Martz] in response to a query on the Jmol listserv.
Some of these techniques were suggested by [https://sourceforge.net/p/jmol/mailman/message/37260020/ Bob Hanson] and [https://sourceforge.net/p/jmol/mailman/message/37259976/ Eric Martz] in response to a query on the Jmol listserv.

Proteopedia Page Contributors and Editors (what is this?)Proteopedia Page Contributors and Editors (what is this?)

Karsten Theis, Eric Martz