Always interested in suggestions!

timothy driscoll wrote:
On 2005-04-21 (11:49) Bob Hanson wrote:


Well, this is probably a problem that is beyond my capabilities to get
around. Still, if this is a general problem, then it's good to get it noted
now so that we can think about how to get around it if necessary in the
future.



http://www.stolaf.edu/people/hansonr/jmol/docs/examples/moveto.htm



hi Bob,

in your showscript() fcn, you try to send a script to the applet via
document.jmol.script(). this is where it breaks down - finding the object
called jmol.  try this instead:

1. add an id param to your applet tag:

id="jmol"

send scripts via getElementById:

document.getElementById('jmol').script()

Remind what breaks down when. Using getElementById() fails in some Mac browsers as noted previously. But I gather that by doing this you have it running on your machine. I note that jmol.js uses document.applets.targetname or, if that doesn't work, document.targetname. So I'm curious as to why getElementById() would be necessary.



I wanted to help, so I downloaded your moveto.htm and examples.js files to see if I could get them running here. I hope you don't mind a few comments...

Can you describe again what the different behavior you observe is between the web-based one and the one you modified? Could you please put up the changed version somewhere so we could compare? That could be really useful.



I see that you are essentially writing your entire page using javascript. this has many disadvantages, including being very difficult to debug, forcing the client machine to do all of the parsing, and making it somewhat dicey to call document objects via javascript (at least on some systems). also, a user can completely shut down the page simply by disabling javascript.

I figure if the user is going to disable JavaScript they are out of luck with ANYTHING I would be writing. All my material is heavily JavaScript dependent. I guess I'm not interested in coding for that crowd. Is that too harsh?



if you are open to suggestions... switch to php or cgi for your html generation. both are dynamic, and both allow you to modularize your code using includes, which seems to me to be what you are trying to accomplish now with js. also, you can get rid of a lot of painful headaches concerning client-side vagarities in js implementation. and finally, when you do run into trouble, it is much, much easier to debug. :-)


Can't use serverside processes here, as the St. Olaf server machines are not "my" machines, but I appreciate the suggestion.


Bob

--

Robert M. Hanson, [EMAIL PROTECTED], 507-646-3107
Professor of Chemistry, St. Olaf College
1520 St. Olaf Ave., Northfield, MN 55057
mailto:[EMAIL PROTECTED]
http://www.stolaf.edu/people/hansonr

"Imagination is more important than knowledge." - Albert Einstein


------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Jmol-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to