Hi Otis,
See if you encounter the same issue with Bob's js script, if you do I will look
into it. Sometimes AJAX messes with the file line delimiters which can cause
this issue. I would like to know what exactly is causing this issue though. We
also just added a new ChemDoodle.io.file.content() function which uses AJAX to
retrieve file content from a local url. I haven't encountered any issues with
it yet. More on it is now in the tutorial (in "Obtain File Content via AJAX"):
http://web.chemdoodle.com/tutorial/loading-data
Hope this helps,
Kevin
On Apr 18, 2012, at 10:52 AM, Robert Hanson wrote:
> Otis, forget that. Don't go there. Period. This is just what we are setting
> up now, and you are going to love it.
>
> 1) Use JmolCD.js
>
> 2) Follow the lead shown in
> http://chemapps.stolaf.edu/jmol/chemdoodle/test2.htm. You can use JmolCD.js
> to create a standard ChemDoodle canvas or a Jmol applet or have Jmol choose
> automatically based on the browser capability.
>
> 3) There is no need to have the MOL data stuffed into a variable that way.
> Just load the file from your server just like for Jmol, even if it is just a
> ChemDoodle canvas, using:
>
> applet.loadFile("xxxx")
>
>
> Bob
>
> On Wed, Apr 18, 2012 at 9:17 AM, Otis Rothenberger <osrot...@chemagic.com>
> wrote:
> All,
>
> I know this is not a ChemDoodle list, but with all the recent ChemDoodle
> activity on the list, I've been playing with the Web Components.
>
> Here's a big frustration, and maybe someone on the list can help me: If I
> literally define a JavaScript molfile variable - e.g.:
>
> lsdfStr = 'CH4\nAPtclcactv04181210043D 0 0.00000 0.00000\n \n 5 4 0 0 0 0 0 0
> 0 0999 V2000\n 0.0000 -0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 0.0000
> -0.8900 -0.6293 H 0 0 0 0 0 0 0 0 0 0 0 0\n 0.0000 0.8900 -0.6293 H 0 0 0 0 0
> 0 0 0 0 0 0 0\n -0.8900 -0.0000 0.6293 H 0 0 0 0 0 0 0 0 0 0 0 0\n 0.8900
> -0.0000 0.6293 H 0 0 0 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0 0 0\n 1 3 1 0 0 0 0\n 1
> 4 1 0 0 0 0\n 1 5 1 0 0 0 0\nM END\n$$$$\n'
>
> then I can dynamically load it into a Transformer3D Canvas - no problem.
>
> If on the other hand I define lsdfStr via AJAX to Resolver, subsequent use of
> the same load routine throws an obscure JS error - TypeError: h is undefined.
>
> If I directly copy the returned AJAX text and paste it into a direct
> definition of lsdfStr, the dynamic load works.
>
> Any thoughts would be appreciated.
>
> Otis
>
> --
> Otis Rothenberger
> o...@chemagic.com
> http://chemagic.com
>
>
>
>
>
> ------------------------------------------------------------------------------
> Better than sec? Nothing is better than sec when it comes to
> monitoring Big Data applications. Try Boundary one-second
> resolution app monitoring today. Free.
> http://p.sf.net/sfu/Boundary-dev2dev
> _______________________________________________
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>
>
>
> --
> 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
> ------------------------------------------------------------------------------
> Better than sec? Nothing is better than sec when it comes to
> monitoring Big Data applications. Try Boundary one-second
> resolution app monitoring today. Free.
> http://p.sf.net/sfu/Boundary-dev2dev_______________________________________________
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users