Including/running own JS-snippets from within a EJS Template?

296 views
Skip to first unread message

Thomas S.

unread,
Mar 30, 2011, 5:15:01 AM3/30/11
to Embedded JavaScript
Hi guys,

I'm rather new to EJS so this might be a basic question:

I created my own EJS template in which I would like to "dynamically"
create new objects.
For implementing the calendar-popup by mattkruse: to be found here:
http://www.mattkruse.com/javascript/calendarpopup/index.html

Now, it seems to me, that the objects, created by the EJS code
(embedded in <% %> )
are not available anymore when the code is rendered...

Currently my code looks like this:
<div id="<%=this['@name']%>" name="<%=this['@name']%>">
<input type="text" class="datefield" name="<%=this['@group']
+"."+this['@name']%>" id="<%=this['@name']%>">
<%
var newCalCode = 'var myCal'+this['@name']+' = new
CalendarPopup(\"'+this['@name']+'\");';
eval (newCalCode);
%>

So as you can see, multiple INPUT-Areas will be created, each of them
needs to have its own "CalendarPopup"
Object...

Any ideas how to achive this?

Best regards,

Tom

Brian Moschel

unread,
Apr 7, 2011, 12:26:09 PM4/7/11
to embeddedj...@googlegroups.com
Please ask on forum.javascriptmvc.com.  We no longer maintain this forum.  That forum will get you EJS answers.

Brian


--
You received this message because you are subscribed to the Google Groups "Embedded JavaScript" group.
To post to this group, send email to embeddedj...@googlegroups.com.
To unsubscribe from this group, send email to embeddedjavascr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/embeddedjavascript?hl=en.




--
Brian Moschel

Jupiter Consulting
\Development\Training\Support
847-727-1609
brian....@gmail.com
Reply all
Reply to author
Forward
0 new messages