mathis.hoffmann-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org
2008-May-18 13:51 UTC
Problem with IE6
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? --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
mathis.hoffmann-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org
2008-May-18 13:54 UTC
Re: Problem with IE6
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, "mathis.hoffm...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org" <mathis.hoffm...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> 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?--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
I just tried it with IE7. Same problem... On 18 Mai, 15:54, "mathis.hoffm...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org" <mathis.hoffm...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> 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, "mathis.hoffm...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org" > > <mathis.hoffm...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> 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?--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Maybe the problem is lack of "tbody"? $(''container'').insert({ bottom: ''<table><tbody><tr><th>Hello</th></tr></tbody></table>'' }) - kangax On May 18, 9:54 am, "mathis.hoffm...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org" <mathis.hoffm...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> 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, "mathis.hoffm...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org" > > <mathis.hoffm...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> 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?--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
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 mathis.hoffmann-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org 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, "mathis.hoffm...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org" > <mathis.hoffm...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
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 <mailingli...-MpvppMsepfk5WgrkcBd8vg@public.gmane.org> 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 > > mathis.hoffm...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org 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, "mathis.hoffm...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org" > > <mathis.hoffm...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
I don''t think the tbody is the issue as I think it''s automatically added by all browsers. Try this but your script tag inside your HEAD element. use: document.observe(''dom:loaded'', function() { //Try this: var table = new Element(''table'') .update("<tr><th>Hallo!</th></tr>"); $(''container'').insert(table); //OR even: $(''container'').update(''<table><tr><th>Hallo!</th></tr></table>''); }); --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---