<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-2">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
span.StylE-mailovZprvy17
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.StylE-mailovZprvy18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 2.0cm 2.0cm 2.0cm;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:2084448127;
mso-list-type:hybrid;
mso-list-template-ids:1990749836 69093068 67436547 67436549 67436545 67436547 67436549 67436545 67436547 67436549;}
@list l0:level1
{mso-level-start-at:0;
mso-level-number-format:bullet;
mso-level-text:-;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-font-family:Calibri;
mso-bidi-font-family:"Times New Roman";}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=CS link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>Hi Lisa,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>try to include scripts/styles in to the head using headicludes tag in your XSD:<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><a href="http://www.opencms-wiki.org/wiki/The_OpenCms_8_Demo_Template_Modules_in_Detail#Headinclude_tag_demo">http://www.opencms-wiki.org/wiki/The_OpenCms_8_Demo_Template_Modules_in_Detail#Headinclude_tag_demo</a><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>But there can be one reason: Your code should be placed in one div<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='color:#1F497D'>Bad Example:<o:p></o:p></span></b></p><p class=MsoNormal><span style='color:#1F497D'><div class=“box“><o:p></o:p></span></p><p class=MsoNormal style='text-indent:35.4pt'><span style='color:#1F497D'><div class=“init“>darkside</div><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'></div><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><script><o:p></o:p></span></p><p class=MsoNormal style='text-indent:35.4pt'><span style='color:#1F497D'>$(document).ready(function() {<o:p></o:p></span></p><p class=MsoNormal style='text-indent:35.4pt'><span style='color:#1F497D'>});<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'></script><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='color:#1F497D'>Good Example:<o:p></o:p></span></b></p><p class=MsoNormal><span style='color:#1F497D'><div class=“box“><o:p></o:p></span></p><p class=MsoNormal style='text-indent:35.4pt'><span style='color:#1F497D'><div class=“box-content“>darkside</div><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span style='color:#1F497D'><script><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt;text-indent:35.4pt'><span style='color:#1F497D'>$(document).ready(function() {<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt;text-indent:35.4pt'><span style='color:#1F497D'>});<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span style='color:#1F497D'></script><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'></div><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Itīs not possible to init „box“ in this example of course.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><p class=MsoNormal><span style='color:#1F497D;mso-fareast-language:CS'>--<br>Regards<br>Filip Kratochvil<br>------------------------------------------------<br>NELASOFT Technologies, s.r.o.<br>E-mail: <a href="mailto:filip.kratochvil@nelasoft.cz"><span style='color:blue'>filip.kratochvil@nelasoft.cz</span></a><br>Web: <a href="http://www.nelasoft.cz" target="_blank"><span style='color:blue'>www.nelasoft.cz</span></a></span><span style='color:#1F497D;mso-fareast-language:CS'><o:p></o:p></span></p></div><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";mso-fareast-language:CS'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";mso-fareast-language:CS'> opencms-dev-bounces@opencms.org [mailto:opencms-dev-bounces@opencms.org] <b>On Behalf Of </b>lruggeri@maticad.it<br><b>Sent:</b> Monday, October 20, 2014 10:57 AM<br><b>To:</b> 'The OpenCms mailing list'<br><b>Subject:</b> [opencms-dev] cms:container included content and jquery ready<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-GB>Hi,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>I have an opencms 8.5.2 template which includes some content using cms:container tags<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>The included content contains javascript code wrapped into $(document).ready() jquery function.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>My problem is that the ready event is firing before the html content of one the cms:container tags is loaded, breaking the javascript code.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>I would like to know if anyone encountered this issue, and if there is a workaround.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>Does cms:container generates javascript in order to include its contents? It’s the only explanation I can find but it does make much sense to me.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>Bye, Lisa<o:p></o:p></span></p></div></body></html>