Craig, you simply first invoke
jmolSetDocument(0);
then when you get that button code, you do it this way:
document.getElement("whatever").innerHTML = jmolButton(....)
That is, Jmol.js then returns the code rather than doing a
document.write(), and you send it to the div.
Bob
Craig T Martin wrote:
> Greetings,
>
> I am trying to develop a WEB page that will display a Jmol image
> and then have two sections along the side. In one section, the user
> can enter full HTML text into a form field, including Jmol.js calls
> (such as 'jmolButton'). The other panel can then load the code from
> the form field into the .innerHTML of the second section (a DIV). The
> goal is to let people test out code snippets before moving them into
> their final HTML files.
>
> The transfer from the form field to the DIV.innerHTML is working
> well and code such as <b>dog</b> correctly displays the word 'dog' in
> bold. All HTML code is properly interpreted. However, when I include
> <script>jmolButton(..,..)</script>, everything from the opening script
> tag to the closing script tag is simply ignored. Other HTML code past
> that point displays correctly.
>
> I'm guessing that I may be trying to do something that browsers
> don't allow - a security issue perhaps? Does anyone have any workarounds?
>
> To see what I have so far and test it out, go to:
> <http://people.chem.umass.edu/cmartin/Jmol/WingedHelixII>
>
> Then click on 'Cmd' at the top and look down to 'Test Bed' and 'Preview'
>
> Thanks,
>
> Craig Martin
> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
>
>
>
>------------------------------------------------------------------------
>
>-------------------------------------------------------------------------
>This SF.net email is sponsored by: Microsoft
>Defy all challenges. Microsoft(R) Visual Studio 2005.
>http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Jmol-users mailing list
>[email protected]
>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: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users