Ah, hah! Well, that's it then. When you pass a script in the applet tag, it becomes a parameter of the object/applet tag. Those parameters do not preserve line endings -- just like HTML. This was the original reason that Miguel thought it would be difficult to build a model from a scripted model file when I asked him about that in my first question to him. Wow, my first interaction with Jmol!
So the proper way to do this is to make the script a callback that will notify the page that the applet is now ready for loading, and then to send that script using jmolScript().
That doesn't appear to be it. I can see all the \n in the string using firebug. I'll keep poking around, but putting the semicolon back in fixed the problem. I haven't got time right now, but remind me where the script is broken into pieces (Tokens?) and I will try to give it a gander. Maybe another pair of eyes will find what is going on.On Feb 3, 2011, at 2:52 PM, Robert Hanson wrote:On Wed, Feb 2, 2011 at 12:56 PM, Jonathan Gutow <email@example.com> wrote:
Cool. What conference exactly?
>That's an idea. I don't remember doing that, but I only recently came
> I did slip that semicolon in somewhere along the way there. So if
> the newline characters. Not a good idea. Are you perhaps splitting
> on \n and forgetting to put that back in? Something's amiss
> there.... I don't think it's a problem inside Jmol.
back to this code after about 4 months off...I'll check. It makes
some sense because what we actually want to do is store the script as
a hidden div in the page, which can get saved on the server and thus
restore user changes across openings of the page. This means that I
did have some massaging to make it work OK in a div. I think I
replaced all the \n with <br/>. The idea being that they would then
be replaced with \n before passing back to the applet. I'm pretty
sure I didn't strip the \n from the backup string version, but I will
That'll do it. I'm sure that's it. The save orientation command does not check to see how many parameters there are, so that next moveto was simply being included on the line of the previous save command. I think if you had used
One clue is that the faulty script string worked fine if I pasted it into the script console of the applet. The problem only occurred when the string was passed as the script in a call to jmolApplet([width,height], scriptStr, AppletID).
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?
Jmol-developers mailing list