|
List Info
Thread: Problems removing a Element
|
|
| Problems removing a Element |

|
2008-01-01 11:47:15 |
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 googlegroups.com
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe googlegroups.com
For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=
en
-~----------~----~----~----~------~----~------~--~---
|
|
| Re: Problems removing a Element |

|
2008-01-02 14:38:41 |
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_JavaScrip
t_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... gmail.com> 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 googlegroups.com
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe googlegroups.com
For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=
en
-~----------~----~----~----~------~----~------~--~---
|
|
| Re: Problems removing a Element |

|
2008-01-02 20:21:06 |
|
except when you need tabular data then divs/css suffers from divitis 
On Jan 3, 2008 9:38 AM, Diodeus < diodeus  gmail.com" >diodeus gmail.com> 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. .. gmail.com">Jermaine2... gmail.com> 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 googlegroups.com To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
|
| Re: Problems removing a Element |

|
2008-01-03 07:42:48 |
Tabular data can work very well with floats.
On Jan 2, 9:21 pm, "Gareth Evans" <agr... gmail.com> wrote:
> except when you need tabular data then divs/css suffers
from divitis
>
> On Jan 3, 2008 9:38 AM, Diodeus <diod... gmail.com> 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/Tra
versing_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... gmail.com> 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 googlegroups.com
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe googlegroups.com
For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=
en
-~----------~----~----~----~------~----~------~--~---
|
|
[1-4]
|
|
|
about | contact Other archives ( Real Estate discussion Medical topics )
|