Thanks. Bob. Using document.getElementById('jmolText'); worked. Thanks for sharing your .js file as well. I'll probably take a look at it at some point. I'm working towards my own at this point and I'm afraid looking at yours will just prevent my learning how to do it myself.

***********************************************
Jeff Hansen
Department of Chemistry and Biochemistry
DePauw University
602 S. College Ave.
Greencastle, IN 46135
[EMAIL PROTECTED]
***********************************************


On Aug 27, 2008, at 11:57 AM, Robert Hanson wrote:

Right -- "name" attribute is quite problematical. In some browsers "id" is accessible as "name", but that's not acceptable. And in some browser versions the name of an element in a form is under the form name rather than the document.

Always use "id" and, as Dean points out, then access it only using document.getElementById()

Most of us create a scrap of JavaScript that we put in all our pages that provides us these services.
One I use is http://www.stolaf.edu/depts/chemistry/gca/divs.js

Bob



On Wed, Aug 27, 2008 at 10:19 AM, Dean Johnston <[EMAIL PROTECTED]> wrote:
Jeff,

No apologies needed. Giving an id to a <div> does not create a Javascript object automatically (at least in Firefox). You will have to use something like:

var myText = document.getElementById('jmolText');

and then say

myText.value = dump(_dataInfo);

It's interesting that it does work in Safari.

Dean



On Wed, Aug 27, 2008 at 11:05 AM, Jeff Hansen <[EMAIL PROTECTED]> wrote:
My apologies.  This is really more of a javascript/html question but
it is on a Jmol project I am working on.  Could someone explain to me
what is the problem with the following code?  The appletReady()
function works just fine in Safari and the page validates as HTML 4.01
strict, but the appletReady() function doesn't work in Firefox.
Firebug reports an error and says jmolText is not defined.

function appletReady() {
var _dataInfo = jmolGetPropertyAsArray("auxiliaryInfo");
jmolText.value = dump(_dataInfo);
}

...

<div id="textDiv">
<form action="">
<p><textarea cols="50" rows="50" id='jmolText'></textarea></p>
</form>
</div>


The page is at http://web.mac.com/jhansen4/Jmol/NewJmolDiv.html if
that will help.


***********************************************
Jeff Hansen
Department of Chemistry and Biochemistry
DePauw University
602 S. College Ave.
Greencastle, IN 46135
[EMAIL PROTECTED]
***********************************************



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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
Northfield, MN
http://www.stolaf.edu/people/hansonr


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
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to