Frederic, #extend actually does augment object passed in. It might also make sense to use a shorter "$" (which extends element implicitly).
- kangax On May 18, 2:17 pm, Frederic Gaus <[EMAIL PROTECTED]> wrote: > Hi Mathis, > > as far as I know, using Element.extend returns an extended element. It > does not change the element passed by parameter. > > So I guess you have to write the following: > > table = Element.extend(table); > > Greetings > > Frederic > > [EMAIL PROTECTED] schrieb: > > > > > Sorry, the code must be: > > <div id="container"> > > </div> > > <script language="javascript" type="text/javascript"> > > var table = document.createElement('table'); > > Element.extend(table); > > var row = document.createElement('tr'); > > Element.extend(row); > > row.update ("<th>Hello!<\/th>"); > > table.update (row); > > $('container').insert({bottom:table}); > > </script> > > > On 18 Mai, 15:51, "[EMAIL PROTECTED]" > > <[EMAIL PROTECTED]> wrote: > >> Hello, > > >> sorry for posting again, but I just start with prototype and therefore > >> have some problems with it... > > >> The following code works in Firefox, but not in IE6: > >> <div id="container"> > >> </div> > >> <script language="javascript" type="text/javascript"> > >> var table = document.createElement('table'); > >> Element.extend(table); > >> var row = document.createElement('tr'); > >> Element.extend(row); > >> row.update ("<th>Hello!<\/th>"); > >> table.update (row); > >> table.update ("<tr><th>Hallo!</th></tr>"); > >> $('container').insert({bottom:table}); > >> </script> > > >> When I change row.update ("<th>Hello!</th>") to row.update ("Hello!") > >> it also works in IE6. table.update ("<tr><th>Hallo!</th></tr>") also > >> works... What is wrong? > > -- > Frederic Gaus pgp-key: 93E6903C > fingerprint: 0C55 4517 CC1E 5F7F 9059 3535 AB54 D8E8 93E6 903C --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---