You need to have a div on your page already that you would reference in
that function.
http://chemapps.stolaf.edu/jmol/jsmol/simple2.htm validates as XHTML, and
no document.write is used in that, for sure, because the body is just this:
<body>
<table style="margin-left:auto; margin-right:auto;">
<tr>
<td><div id="leftpanel"></div></td>
<td><div id="middlepanel"></div></td>
<td><div id="rightpanel"></div></td>
</tr>
<tr>
<td></td>
<td style="text-align:center"><div id="lowerpanel"></div></td>
<td></td>
</tr>
</table>
<div id="console"></div>
</body>
Bob
On Wed, Mar 6, 2013 at 4:33 PM, Greg.Black <[email protected]> wrote:
> Bob,
>
> I tried this by constructing a very simple JSmol page (xhtml). I added the
> $(document).ready(function{}) as you suggest. The function is being called
> but the browser still complains about document.write(). I assumed it is the
> div containing the JSmol that I need to call setXHTML() on:
>
> $(document).ready(function() {
> Jmol.setXHTML("jmolApplet0_appletdiv");
> });
>
> I wasn't sure about the id of the DOM element. After this I have the usual
> self-invoking function to set up JSmol.
>
> I'm probably being dumb. Do you have an example file?
>
> Greg
>
>
> Date: Wed, 6 Mar 2013 12:20:44 -0600
> From: Robert Hanson <[email protected]>
> Subject: Re: [Jmol-users] JSmol in ePub3
> To: "[email protected]"
> <[email protected]>
> Message-ID:
> <
> caf_yuvvj8k7wm44gvaapbjpeodu7sfpwfcbqvsemrxtove0...@mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Jmol.setXHTML(id)
>
> -- id is the DOM element that will be used for appending to instead of
> document.write.
>
> Should work; can't say I've tested it recently. Recommend using that with
> $(document).ready(function{}). Please let me know how it goes. I'd like to
> fix any problems.
>
> Bob
>
>
>
> On Wed, Mar 6, 2013 at 9:45 AM, Greg.Black <[email protected]> wrote:
>
> > Hi,
> >
> > I have used JSmol successfully in webpages on a server from a .html file.
> > I am looking into the possibility of including JSmol in an ePub3. This
> > means including valid XHTML (strictly speaking I think that means the XML
> > serialisation of HTML5). I tried making a .xhtml file but got errors
> about
> > document.write, which is not allowed in XHTML.
> >
> > Has anyone tried including JSmol in an ePub3 or even got JSmol working in
> > a .xhtml page?
> >
> > Greg
> >
> >
> >
> >
> >
> > --
> > The Open University is incorporated by Royal Charter (RC 000391), an
> > exempt charity in England & Wales and a charity registered in Scotland
> (SC
> > 038302).
> >
> >
>
> --
> Robert M. Hanson
> Larson-Anderson Professor of Chemistry
> Chair, Chemistry Department
> 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
>
>
> ------------------------------------------------------------------------------
> Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
> Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
> endpoint security space. For insight on selecting the right partner to
> tackle endpoint security challenges, access the full report.
> http://p.sf.net/sfu/symantec-dev2dev
> _______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
--
Robert M. Hanson
Larson-Anderson Professor of Chemistry
Chair, Chemistry Department
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
------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
endpoint security space. For insight on selecting the right partner to
tackle endpoint security challenges, access the full report.
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users