On May 23, 2010, at 7:15 PM, Otis Rothenberger wrote:
> Hi Again Phil,
>
> Salmon Cakes.
Sounds good!!
Actually, I am on a Mac using Safari. And I call a function because I want to
do some other stuff in setting up the problem. The following is my preliminary
function script. The first three lines are attempts to clear the applet.
Only the void line works. (I understand Bob's nah, but I do not understand
why the other two do not do the job.) It is true on Mac FireFox as well. All
three lines are obviously currently commented out. But using any one of them
fails -- except the void reset
function newProblem(){
//document.getElementById("JME").readMolecule("");
//void JME.reset();
//document.getElementById("JME").reset();
Problem = Problem + 1;
document.getElementById("IUPAC").innerHTML = Compound[Problem][0];
}
>
> Anyway, It sounds like you may be using the following context:
>
> href = "javascript: document.getElementById("JME").reset()
>
> That may require a preceding void() (maybe "void" also works). This all
> depends on what is returned by reset(). This aspect (uncertainty) of
> running Javascript from a link href always bugged me, so I use a
> different approach. I define a null function in my site JavaScript code:
>
> nullFunction(){}
>
> It always returns null, and it keeps href happy and, more importantly,
> inactive - i.e. href = "javascript: nullFunction();"
>
> I then put my real JavaScript function into onclick =
> "document.getElementById("JME").reset()". Onclick doesn't give a hoot
> about returned values. It just runs the JavaScript.
>
> More than you wanted to know!
>
> By the way, the pre-dinner thought was to use the following, which also
> works:
>
> document.getElementById("JME").readMolecule("")
>
> Otis
>
> On 5/23/2010 6:23 PM, Philip Bays wrote:
>> hmmm.
>>
>> void JME.reset();
>>
>> seems to work.
>>
>>
>> On May 23, 2010, at 6:08 PM, Otis Rothenberger wrote:
>>
>>
>>> Phil,
>>>
>>> Reset works on my Windows/Firefox. Let me play with another idea that I
>>> have, and I'll get back to you. Wife calling me for dinner. I'll write
>>> back in about an hour.
>>>
>>> Otis
>>>
>>> On 5/23/2010 6:01 PM, Philip Bays wrote:
>>>
>>>> Otis:
>>>>
>>>> That is what I thought too. But it does not do it for me. Stops the
>>>> processing at that point.
>>>>
>>>> Phil
>>>>
>>>> On May 23, 2010, at 5:26 PM, Otis Rothenberger wrote:
>>>>
>>>>
>>>>
>>>>> Phil,
>>>>>
>>>>> document.getElementById("JME").reset()
>>>>>
>>>>> where JME is the ID of the applet.
>>>>>
>>>>>
>>>>> Otis
>>>>>
>>>>> On 5/23/2010 4:44 PM, Philip Bays wrote:
>>>>>
>>>>>
>>>>>> What is the javascript statement to clear the drawing in JME?
>>>>>>
>>>>>> document.getElementById("JME").???
>>>>>>
>>>>>> J. Philip Bays
>>>>>> Professor of Chemistry
>>>>>> Department of Chemistry and Physics
>>>>>> Saint Mary's College
>>>>>> Notre Dame, IN 46556
>>>>>> (574) 284-4663
>>>>>> [email protected]
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>>
>>>>>> _______________________________________________
>>>>>> Jmol-users mailing list
>>>>>> [email protected]
>>>>>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>> --
>>>>> Otis Rothenberger
>>>>> chemagic.com
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>>
>>>>> _______________________________________________
>>>>> Jmol-users mailing list
>>>>> [email protected]
>>>>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>>>>
>>>>>
>>>> J. Philip Bays
>>>> Professor of Chemistry
>>>> Department of Chemistry and Physics
>>>> Saint Mary's College
>>>> Notre Dame, IN 46556
>>>> (574) 284-4663
>>>> [email protected]
>>>>
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>>
>>>> _______________________________________________
>>>> Jmol-users mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>>>
>>>>
>>>>
>>> --
>>> Otis Rothenberger
>>> chemagic.com
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Jmol-users mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>>
>> J. Philip Bays
>> Professor of Chemistry
>> Department of Chemistry and Physics
>> Saint Mary's College
>> Notre Dame, IN 46556
>> (574) 284-4663
>> [email protected]
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>>
>> _______________________________________________
>> Jmol-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>
>>
>
> --
> Otis Rothenberger
> chemagic.com
>
>
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
J. Philip Bays
Professor of Chemistry
Department of Chemistry and Physics
Saint Mary's College
Notre Dame, IN 46556
(574) 284-4663
[email protected]
------------------------------------------------------------------------------
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users