Hi,

I think I'm misunderstanding, why do you need to use script to create
a script tag with inline script? Wouldn't it work just to do the work
directly? E.g.:

function loader() {

    new CalendarDateSelect(
        $('cds_placeholder_105hd1').previous(),
        {
            embedded:   true,
            year_range: 10
        }
    );
}

That should have exactly the same effect as inserting a script tag to
do it...or am I missing something?

HTH,
--
T.J. Crowder
Independent Software Consultant
tj / crowder software / com
www.crowdersoftware.com


On Mar 19, 3:56 pm, 99miles <99mi...@gmail.com> wrote:
> 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 
> fromhttp://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 prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to