Hi T.J.,

Here it is the complete html

<table style="position:relative;" border="0" width="100%">
<tr>

<td >
          <table border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr>
            <td width="75%">
            <div  class="div-display">
                 <table border="0" class="table-display" width="100%">
                 <tr>
                      <td class="display-heading"></td>

                </tr>

               </table>

         <div id="A"></div>
        </div>
         </td>
</tr>
</table>
</td>
</tr>
</table>
-------------------
Then I insert into the empty div with id "A" above another div with
id="B"(that comes as an html string from the server with)

$('A').insert( "<div id=\"B\" class=\"save-page-bar\"><a
id=\"saveAnswersBtn\" href=\"javascript:allRequiredFieldsAnswered();\"
class=\"btn\">Save</a><a id=\"cancelSaveAnswersBtn\"
href=\"javascript:cancelFormSave();\"
class=\"btn\">Cancel</a></div>",'top');

when the user presses the Cancel button (that is inside the div "B"), the
cancelFormSave() js function is called which removes div 'B' with

$('B').remove();

Then I repeat the whole thing a second time: Insert it again and press the
button to remove 'B'. I get $('B').parentnode is null and doesnt remove

Thanks
On Fri, Aug 6, 2010 at 11:12 AM, T.J. Crowder <t...@crowdersoftware.com>wrote:

> Hi,
>
> Can you show your _actual_ code? The lines you quoted don't quite add
> up (I assume they were just pseudocode examples).
> --
> T.J. Crowder
> Independent Software Consultant
> tj / crowder software / com
> www.crowdersoftware.com
>
>
> On Aug 6, 2:39 pm, zef <zef.andr...@gmail.com> wrote:
> > Hi,
> >
> > I am using prototype 1.6.1. I am adding a child div with id B to a
> > parent div with id A. Then a while later I remove B.
> >
> > Like this
> >
> > $('A').insert(html for div B,'top');
> >
> > $('B').remove();
> >
> > This works fine the first time. But when I insert the div B a second
> > time then remove it, I get an error in firefox:
> >
> > $('B').parentnode is null.
> >
> > If I look into $('A').innerHTML just before removing B though I can
> > see it there.
> >
> > The problem only shows up in firefox (in several versions like 3.6.8
> > or 3.0.14). On IE8 it works fine.
>
> --
> 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
> prototype-scriptacul...@googlegroups.com.
> To unsubscribe from this group, send email to
> prototype-scriptaculous+unsubscr...@googlegroups.com<prototype-scriptaculous%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/prototype-scriptaculous?hl=en.
>
>

-- 
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 prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to