You have to make sure you use ";" if the script is to be part of the applet tag. Simple† \n line terminations will not work,and you cannot just load a model using the DATA command this way.


textareas are WAY BAD ideas, because different browsers (historically at least) treat the line endings different ways.

You should always use jmolScript() to send models and scripts to Jmol. Never use contents of divs or textareas directly.

Bob



2011/2/4 Angel HerrŠez <angel.herraez@uah.es>
I'm rather surprised about the last posts in this thread. Up to now,
I had the "knowledge" that the safest way to avoid timing problems
was to put the script in the jmolApplet call and not in a jmolScript.
Now it seems there are situations where the other is better (plus the
callback, of course).

Jonathan, just a note. I cannot give details now (this is sort of an
accumulated perception), but my troubles with line endings have
always been less if using a textarea to hold the data. So maybe your
hidden DIV could instead be a hidden TEXTAREA and you need less
massaging and have less trouble.
I think that the browsers handle better the newlines in textareas.
At least this is what I reached when experimenting with passing model
data between the 2D drawing applet (JChemPaint or others) and the 3D
viewing applet (Jmol).



------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world?
http://p.sf.net/sfu/oracle-sfdevnlfb
_______________________________________________
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers



--
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


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