From: Bob H. <ha...@st...> - 2004-11-20 00:45:29
|
What you need is some JavaScript that does the following: (provided 10pre17 works) molecule="|"+molecule.replace(/\|/g,"") molecule=molecule.replace(/\r\n/g,"|") molecule=molecule.replace(/\n/g,"|") molecule=molecule.replace(/\r/g,"|") molecule=molecule.replace(/\|/g,"\n|") This corrects for different browser endline issues. fr chalaoux wrote: > Hi All, > > I tried to load a string from my database in the JmolApplet . > The probleme is that the applet is loaded but apparently not the > molecule in the applet. > > Any idea ? > > Bye, FR. > > > Code with jmol10 pre17 > =================== > <html> > <head> > <title>nitrogens</title> > <script src="../jmol/Jmol.js"></script> <!-- REQUIRED --> > <script language="JavaScript"> > function init() { > var molecule; > molecule = document.TheForm.amol.value; > jmolLoadInline(molecule); > } > </script> > </head> > > <body onload="init()"> > <form name="TheForm"> > <input type="text" name="amol" value="REMARK FINAL COORDINATES WRITTEN > BY NAMD AT TIMESTEP 1000 > ATOM 1 C1 LIG 1 0.708 -1.202 0.152 0.00 0.00 LIG > ATOM 2 C2 LIG 1 0.813 0.302 0.452 0.00 0.00 LIG > ATOM 3 C3 LIG 1 -0.563 1.002 0.405 0.00 0.00 LIG > ATOM 4 C4 LIG 1 -1.701 0.128 -0.154 0.00 0.00 LIG > ATOM 5 N1 LIG 1 -0.382 -1.824 0.907 0.00 0.00 LIG > ATOM 6 C5 LIG 1 -1.695 -1.256 0.535 0.00 0.00 LIG > ATOM 7 C6 LIG 1 1.856 1.000 -0.438 0.00 0.00 LIG > ATOM 8 N2 LIG 1 3.228 0.639 -0.038 0.00 0.00 LIG > ATOM 9 C7 LIG 1 4.000 -0.096 -1.050 0.00 0.00 LIG > ATOM 10 C8 LIG 1 3.989 1.762 0.529 0.00 0.00 LIG > ATOM 11 N3 LIG 1 -3.014 0.806 -0.023 0.00 0.00 LIG > ATOM 12 C9 LIG 1 -3.053 2.184 -0.548 0.00 0.00 LIG > ATOM 13 C10 LIG 1 -4.206 0.065 -0.483 0.00 0.00 LIG > ATOM 14 C11 LIG 1 -0.365 -3.289 0.762 0.00 0.00 LIG > ATOM 15 F1 LIG 1 -4.439 -1.057 0.271 0.00 0.00 LIG > ATOM 16 H1 LIG 1 0.561 -1.398 -0.913 0.00 0.00 LIG > ATOM 17 H2 LIG 1 1.638 -1.691 0.444 0.00 0.00 LIG > ATOM 18 H3 LIG 1 1.166 0.408 1.480 0.00 0.00 LIG > ATOM 19 H4 LIG 1 -0.479 1.919 -0.177 0.00 0.00 LIG > ATOM 20 H5 LIG 1 -0.836 1.321 1.413 0.00 0.00 LIG > ATOM 21 H6 LIG 1 -1.514 -0.009 -1.223 0.00 0.00 LIG > ATOM 22 H7 LIG 1 -2.271 -1.205 1.461 0.00 0.00 LIG > ATOM 23 H8 LIG 1 -2.205 -1.963 -0.121 0.00 0.00 LIG > ATOM 24 H9 LIG 1 1.698 0.753 -1.490 0.00 0.00 LIG > ATOM 25 H10 LIG 1 1.752 2.084 -0.364 0.00 0.00 LIG > ATOM 26 H11 LIG 1 4.072 0.508 -1.958 0.00 0.00 LIG > ATOM 27 H12 LIG 1 5.010 -0.284 -0.674 0.00 0.00 LIG > ATOM 28 F2 LIG 1 3.380 -1.290 -1.314 0.00 0.00 LIG > ATOM 29 H13 LIG 1 4.215 2.490 -0.254 0.00 0.00 LIG > ATOM 30 H14 LIG 1 4.920 1.391 0.964 0.00 0.00 LIG > ATOM 31 H15 LIG 1 3.401 2.242 1.312 0.00 0.00 LIG > ATOM 32 H16 LIG 1 -2.759 2.196 -1.599 0.00 0.00 LIG > ATOM 33 H17 LIG 1 -4.060 2.593 -0.450 0.00 0.00 LIG > ATOM 34 H18 LIG 1 -2.394 2.829 0.033 0.00 0.00 LIG > ATOM 35 H19 LIG 1 -4.088 -0.200 -1.536 0.00 0.00 LIG > ATOM 36 H20 LIG 1 -5.084 0.709 -0.393 0.00 0.00 LIG > ATOM 37 H21 LIG 1 -1.205 -3.722 1.309 0.00 0.00 LIG > ATOM 38 H22 LIG 1 -0.444 -3.563 -0.293 0.00 0.00 LIG > ATOM 39 H23 LIG 1 0.566 -3.692 1.168 0.00 0.00 LIG > ATOM 40 H24 LIG 1 -0.221 -1.609 1.886 0.00 0.00 LIG > END"> > </form> > <script> > jmolSetCodebase("../jmol"); > jmolApplet(200, ""); > </script> > </body> > > </html> > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: InterSystems CACHE > FREE OODBMS DOWNLOAD - A multidimensional database that combines > robust object and relational technologies, making it a perfect match > for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 > _______________________________________________ > Jmol-users mailing list > Jmo...@li... > https://lists.sourceforge.net/lists/listinfo/jmol-users -- Robert M. Hanson, ha...@st..., 507-646-3107 Professor of Chemistry, St. Olaf College 1520 St. Olaf Ave., Northfield, MN 55057 mailto:ha...@st... http://www.stolaf.edu/people/hansonr "Imagination is more important than knowledge." - Albert Einstein |