[opencms-dev] R: cms:container included content and jquery ready

lruggeri at maticad.it lruggeri at maticad.it
Mon Oct 20 12:22:28 CEST 2014


Hi Filip,

Thank you for your reply.

The content I’m including is of type DynamicFunction (the xsd content type
definition is provided by opencms).

The headinclude tag will include scripts referenced in the xsd, so I cannot
use this feature.

 

I looked at the source of my Function provider (the jsp that provides
content to DynamicFunction content) and I already wrapped it in div.

I really cannot understand this strange behaviour. If the html is generated
server side all-in-once, how is it possible that document loaded fires
before the content of one of the cms:container tags is loaded?

 

Bye, Lisa

 

Da: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org]
Per conto di Filip Kratochvil
Inviato: lunedì 20 ottobre 2014 11.59
A: 'The OpenCms mailing list'
Oggetto: Re: [opencms-dev] cms:container included content and jquery ready

 

Hi Lisa,

 

try to include scripts/styles in to the head using headicludes tag in your
XSD:

http://www.opencms-wiki.org/wiki/The_OpenCms_8_Demo_Template_Modules_in_Deta
il#Headinclude_tag_demo

 

But there can be one reason: Your code should be placed in one div

 

Bad Example:

<div class=“box“>

<div class=“init“>darkside</div>

</div>

<script>

$(document).ready(function() {

});

</script>

 

Good Example:

<div class=“box“>

<div class=“box-content“>darkside</div>

<script>

$(document).ready(function() {

});

</script>

</div>

 

It´s not possible to init „box“ in this example of course.

 

--
Regards
Filip Kratochvil
------------------------------------------------
NELASOFT Technologies, s.r.o.
E-mail:  <mailto:filip.kratochvil at nelasoft.cz> filip.kratochvil at nelasoft.cz
Web:  <http://www.nelasoft.cz> www.nelasoft.cz

 

From: opencms-dev-bounces at opencms.org
<mailto:opencms-dev-bounces at opencms.org>
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of lruggeri at maticad.it
<mailto:lruggeri at maticad.it> 
Sent: Monday, October 20, 2014 10:57 AM
To: 'The OpenCms mailing list'
Subject: [opencms-dev] cms:container included content and jquery ready

 

Hi,

I have an opencms 8.5.2 template which includes some content using
cms:container tags

The included content contains javascript code wrapped into
$(document).ready() jquery function.

 

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.

I would like to know if anyone encountered this issue, and if there is a
workaround.

 

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.

Bye, Lisa

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20141020/d0659f38/attachment.htm>


More information about the opencms-dev mailing list