On Jul 3, 7:04 pm, El Bastardo <[email protected]> wrote:
> That's exactly what stands in the documentary and what already did not
> help me out.
>
> Should I literally write "element."?? - WHen I do that it doesn't work
> and firebug gives me errors.
>
> Can't someone please type down the changed thin it's just two lines
> where the old insertion is now??
>
> To clarify again I tried this:
>
> if( 'object'== typeof date) // date object was returned (i.e. as
> expected)
> {
> date_header.lastChild.nodeValue="";
> element.insert(
> {bottom:date_header,
> Calendar.renderHTML( date,
> text)}
> )
> }
> else
> // not-a-date-object-but-something-else was returned ->
> error
> {
> element.insert(
> {bottom:date_header,
> "<span
> style='color:red;font-style:italic'>" + date + "</span>"}
> );
> }
>
> Nothing happens. As I said before. I even do not understand what
> element here and what goes into what.
>
> So if someone could please just change the old parts into the new that
> would be great!!
Rumata wasn't very clear. Where they wrote 'element' they meant you to
replace that by the element in your code that you want to update
(either a Javascript variable or an expression).
So you want
date_header.insert({bottom: Calendar.renderHTML( date, text)})_;
which means "insert the result of Calendar.renderHTML at the bottom of
date_header".
However, for this to work, your 'date_header' variable must have been
extended into a Prototype Element. So unless you know that has already
happened, you should write
$(date_header).insert( ...
(Or you could put
date_header = $(date_header)
further up in your program.
Colin
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---