When the dom is loaded, I call this method where I try to insert a
CalendarDateSelect into an existing div tag, but it's not working:

function loader() {
        var newScript   = document.createElement('script');
        newScript.type  = 'text/javascript';
        newScript.innerHTML = 'new CalendarDateSelect( $
(\'cds_placeholder_105hd1\').previous(), {embedded:true, year_range:
10} );';
        //newScript.innerHTML = 'alert("foo")';
        $('date_area').insert(newScript);
}

But, if I comment out the first 'innerHTML' line, and uncomment the
second, the alert pops up as expected. So, it seems like this should
work.

CalendarDateSelect is a component from
http://code.google.com/p/calendardateselect/wiki/JavascriptDocumentation,
and that call should create a calendar. I have other pages where I
display the calendar from ruby on rails code which ends up outputting
the following and it display just great.

<script type="text/javascript">
  //<![CDATA[
  new CalendarDateSelect( $('cds_placeholder_10511').previous(),
{embedded:true, year_range:10} );
  //]]>
  </script>

Any ideas?
Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to