thorasmund-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2008-Mar-13 06:44 UTC
Inserting replaced element causes text to disappear in IE6
I posted this to the bug tracker, but nothing has happened so far, so allow me to post it here. It seems that replacing an element in the document, then inserting the replaced element again, causes the inserted element to lose its content in IE6. (FF2 works). I am running prototype 1.6.0.2 An example: <button id="testButton">Test button</button> <script class="text/javascript"> Event.observe(window, ''load'', function(){ var replacedButton = $(''testButton'').replace(''<p id="testPara">Test</ p>''); $(''testPara'').insert(replacedButton); }); </script> A live example can be seen here. http://nafai.org/temp/insertionproblem Have I overlooked something, or is this as a bug? many thanks --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jon L.
2008-Mar-13 17:50 UTC
Re: Inserting replaced element causes text to disappear in IE6
Admittedly, I''m only learning Prototype. But, aren''t you missing a parameter? http://prototypejs.org/api/element#method-replace - Jon L. On Mar 13, 1:44 am, "thorasm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <thorasm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I posted this to the bug tracker, but nothing has happened so far, so > allow me to post it here. > > It seems that replacing an element in the document, then inserting the > replaced element again, causes the inserted element to lose its > content in IE6. (FF2 works). I am running prototype 1.6.0.2 > > An example: > > <button id="testButton">Test button</button> > > <script class="text/javascript"> > Event.observe(window, ''load'', function(){ > var replacedButton = $(''testButton'').replace(''<p id="testPara">Test</ > p>''); > $(''testPara'').insert(replacedButton);}); > > </script> > > A live example can be seen here. > > http://nafai.org/temp/insertionproblem > > Have I overlooked something, or is this as a bug? > > many thanks--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Justin Perkins
2008-Mar-13 18:54 UTC
Re: Inserting replaced element causes text to disappear in IE6
After looking at your code, I''m having a hard time figuring out what the goal of this is? You have a button element and you are replacing it with a paragraph and then your are inserting the same node into the new paragraph element? If you can explain what you''re trying to do, we can probably find an easier way to accomplish this. -justin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
thorasmund-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2008-Mar-13 23:30 UTC
Re: Inserting replaced element causes text to disappear in IE6
This was a simplified example to show what happens when you remove something and insert it again. The only reason I inserted it in the paragraph was so that I didn''t have to add any extra code to the example. As for Jon L.''s comment: Replace, when applied directly to an object, can be called with zero parameters (in which case nothing is inserted instead of the replaced object), or one parameter (which is then inserted). On Mar 14, 3:54 am, "Justin Perkins" <justinperk...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> After looking at your code, I''m having a hard time figuring out what > the goal of this is? > > You have a button element and you are replacing it with a paragraph > and then your are inserting the same node into the new paragraph > element? > > If you can explain what you''re trying to do, we can probably find an > easier way to accomplish this. > > -justin--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---