Hello Everyone. This is what I have in my javascript file: function Testing() { new Insertion.After(''my_id'', ''<tr id="test_row">\ <td>Hello World!</td> \ <td><a href="#" onclick="$(this).remove();">remove</a></td></ tr>''); } And this is what I have in my HTML file: <a href=# onclick="Testing()">Add a new ''Hello World'' entry</a> => As you can see, I create these ''hello world'' messages dynamically each time I click the ''just a test'' link. Ideally I want to be able to remove the whole table row as well. This however I''m having a hard time with, because this doesn''t seem to work: <a href="#" onclick="$(this).remove();">remove</a> Anyone an Idea or suggestion?? - Jermaine --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hello Everyone. This is what I have in my javascript file: function Testing() { new Insertion.After(''my_id'', ''<tr id="test_row">\ <td>Hello World!</td> \ <td><a href="#" onclick="$(this).remove();">remove</a></td></ tr>''); } And this is what I have in my HTML file: <a href=# onclick="Testing()">Add a new ''Hello World'' entry</a> => As you can see, I create these ''hello world'' messages dynamically each time I click the ''just a test'' link. Ideally I want to be able to remove the whole table row as well. This however I''m having a hard time with, because this doesn''t seem to work: <a href="#" onclick="$(this).remove();">remove</a> Anyone an Idea or suggestion?? - Jermaine --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
You cannot add or remove table rows this way. Tables don''t play well with others. You need to do it at a DOM level. see: http://developer.mozilla.org/en/docs/Traversing_an_HTML_table_with_JavaScript_and_DOM_Interfaces Alternately: give up on tables and use DIVs/CSS. You''ll thank me for it. On Jan 1, 12:47 pm, Jermaine <Jermaine2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello Everyone. > This is what I have in my javascript file: > > function Testing() { > new Insertion.After(''my_id'', ''<tr id="test_row">\ > <td>Hello World!</td> > \ > <td><a href="#" > onclick="$(this).remove();">remove</a></td></ > tr>''); > > } > > And this is what I have in my HTML file: > <a href=# onclick="Testing()">Add a new ''Hello World'' entry</a> > > => As you can see, I create these ''hello world'' messages dynamically > each time I click the ''just a test'' link. > > Ideally I want to be able to remove the whole table row as well. This > however I''m having a hard time with, because this doesn''t seem to > work: <a href="#" onclick="$(this).remove();">remove</a> > > Anyone an Idea or suggestion?? > > - Jermaine--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
except when you need tabular data then divs/css suffers from divitis :) On Jan 3, 2008 9:38 AM, Diodeus <diodeus-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > You cannot add or remove table rows this way. Tables don''t play well > with others. You need to do it at a DOM level. > > see: > http://developer.mozilla.org/en/docs/Traversing_an_HTML_table_with_JavaScript_and_DOM_Interfaces > > Alternately: give up on tables and use DIVs/CSS. You''ll thank me for > it. > > > On Jan 1, 12:47 pm, Jermaine <Jermaine2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hello Everyone. > > This is what I have in my javascript file: > > > > function Testing() { > > new Insertion.After(''my_id'', ''<tr id="test_row">\ > > <td>Hello World!</td> > > \ > > <td><a href="#" > > onclick="$(this).remove();">remove</a></td></ > > tr>''); > > > > } > > > > And this is what I have in my HTML file: > > <a href=# onclick="Testing()">Add a new ''Hello World'' entry</a> > > > > => As you can see, I create these ''hello world'' messages dynamically > > each time I click the ''just a test'' link. > > > > Ideally I want to be able to remove the whole table row as well. This > > however I''m having a hard time with, because this doesn''t seem to > > work: <a href="#" onclick="$(this).remove();">remove</a> > > > > Anyone an Idea or suggestion?? > > > > - Jermaine > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Tabular data can work very well with floats. On Jan 2, 9:21 pm, "Gareth Evans" <agr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> except when you need tabular data then divs/css suffers from divitis :) > > On Jan 3, 2008 9:38 AM, Diodeus <diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > You cannot add or remove table rows this way. Tables don''t play well > > with others. You need to do it at a DOM level. > > > see: > >http://developer.mozilla.org/en/docs/Traversing_an_HTML_table_with_Ja... > > > Alternately: give up on tables and use DIVs/CSS. You''ll thank me for > > it. > > > On Jan 1, 12:47 pm, Jermaine <Jermaine2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hello Everyone. > > > This is what I have in my javascript file: > > > > function Testing() { > > > new Insertion.After(''my_id'', ''<tr id="test_row">\ > > > <td>Hello World!</td> > > > \ > > > <td><a href="#" > > > onclick="$(this).remove();">remove</a></td></ > > > tr>''); > > > > } > > > > And this is what I have in my HTML file: > > > <a href=# onclick="Testing()">Add a new ''Hello World'' entry</a> > > > > => As you can see, I create these ''hello world'' messages dynamically > > > each time I click the ''just a test'' link. > > > > Ideally I want to be able to remove the whole table row as well. This > > > however I''m having a hard time with, because this doesn''t seem to > > > work: <a href="#" onclick="$(this).remove();">remove</a> > > > > Anyone an Idea or suggestion?? > > > > - Jermaine--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
It''s a little silly to use floats to try to recreate a table structure, especially if it is a large table with many columns, thead & tfoot, etc. Use HTML elements for what they were meant for... h1 h2 h3 for headings, table for tabular data, etc. Too many people have gone overboard with divs & spans, which have no inherent meaning. It makes me cringe to see things like <span class="bold"> and <div class="header">. On Jan 3, 8:42 am, Diodeus <diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Tabular data can work very well with floats.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---