I have the following type of html content. When I replace or remove div with id=d1, all the divs underneath d1 also disappears. This happens only in IE, but works fine in Firefox. Appreciate any help for the fix. Thanks Booshan <div id="d1"></div> <div id="d2"></div> <div id="d3"></div> <div id="d4"></div> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
can you post the actual JS? On Mar 6, 10:52 am, "Booshan" <santhi.boos...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have the following type of html content. When I replace or remove > div with id=d1, all the divs underneath d1 also disappears. This > happens only in IE, but works fine in Firefox. Appreciate any help for > the fix. > > Thanks > Booshan > > <div id="d1"></div> > <div id="d2"></div> > <div id="d3"></div> > <div id="d4"></div>--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
JS for replace and remove looks like this... $(''d1'').replace( "<div id=''d1''>Some Data</div>"); $(''d1'').remove(); Thanks Booshan On Mar 6, 2:27 pm, "wiggles" <buchanan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> can you post the actual JS? > > On Mar 6, 10:52 am, "Booshan" <santhi.boos...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I have the following type of html content. When I replace or remove > > div with id=d1, all the divs underneath d1 also disappears. This > > happens only in IE, but works fine in Firefox. Appreciate any help for > > the fix. > > > Thanks > > Booshan > > > <div id="d1"></div> > > <div id="d2"></div> > > <div id="d3"></div> > > <div id="d4"></div>--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Appreciate any help on this problem. On Mar 6, 2:53 pm, "Booshan" <santhi.boos...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> JS for replace and remove looks like this... > > $(''d1'').replace( "<div id=''d1''>Some Data</div>"); > > $(''d1'').remove(); > > Thanks > Booshan > > On Mar 6, 2:27 pm, "wiggles" <buchanan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > can you post the actual JS? > > > On Mar 6, 10:52 am, "Booshan" <santhi.boos...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > I have the following type of html content. When I replace or remove > > > div with id=d1, all the divs underneath d1 also disappears. This > > > happens only in IE, but works fine in Firefox. Appreciate any help for > > > the fix. > > > > Thanks > > > Booshan > > > > <div id="d1"></div> > > > <div id="d2"></div> > > > <div id="d3"></div> > > > <div id="d4"></div>--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
1. Be patient. It''s only been 90 minutes since you posted. This list is most active in the late afternoon/evening (for my time zone, anyway), as many members are in Europe. 2. Debugging is a skill. a. Often, more information is helpful. For example, in this case, it is not possible to determine the extra removals aren''t being caused by some other line of code that you didn''t post. b. Online examples are helpful when asking for reviewers. c. Minimal cases are extremely helpful, and will often direct you to the cause of the bug. d. Turn CSS off to ensure it''s a Javascript problem, not a CSS problem. e. What version of Prototype are you using? You''ve identified a particular browser (helpful), but not a browser version (less helpful). f. Don''t be scared to look under the hood in Prototype. In this case it''s unlikely (possible, but unlikely) that a function that''s been stable through multiple versions and unit tests is acting improperly. For example, the code for Element.remove is very straightforward, and uses DOM methods: // ... remove: function(element) { element = $(element); element.parentNode.removeChild(element); return element; } // ... TAG On Mar 6, 2007, at 2:19 PM, Booshan wrote:> > Appreciate any help on this problem. > > On Mar 6, 2:53 pm, "Booshan" <santhi.boos...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> JS for replace and remove looks like this... >> >> $(''d1'').replace( "<div id=''d1''>Some Data</div>"); >> >> $(''d1'').remove(); >> >> Thanks >> Booshan >> >> On Mar 6, 2:27 pm, "wiggles" <buchanan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >>> can you post the actual JS? >> >>> On Mar 6, 10:52 am, "Booshan" <santhi.boos...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >>>> I have the following type of html content. When I replace or remove >>>> div with id=d1, all the divs underneath d1 also disappears. This >>>> happens only in IE, but works fine in Firefox. Appreciate any >>>> help for >>>> the fix. >> >>>> Thanks >>>> Booshan >> >>>> <div id="d1"></div> >>>> <div id="d2"></div> >>>> <div id="d3"></div> >>>> <div id="d4"></div> > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Mar 7, 5:53 am, "Booshan" <santhi.boos...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> JS for replace and remove looks like this... > > $(''d1'').replace( "<div id=''d1''>Some Data</div>"); > > $(''d1'').remove();You''ll have to try harder: <script type="text/javascript" src="prototype.js"></script> <div id="d1">d1</div> <div id="d2">d2</div> <div id="d3">d3</div> <div id="d4">d4</div> <button onclick=" $(''d1'').replace( ''<div id=d1>Some Data</div>''); $(''d1'').remove(); ">Replace & remove d1</button> Works fine in Prototype.js 1.5. -- Rob --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Is there an easy way to change the i-bar on the autocomplete to a pointer? Deco --~--~---------~--~----~------------~-------~--~----~ 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 may want to put *something* in your divs too, i''ve had weird effects but mainly with the tree-view in IE7 when divs are empty. Gareth On 3/7/07, RobG <rgqld-AFFH1GffN5hPR4JQBCEnsQ@public.gmane.org> wrote:> > > On Mar 7, 5:53 am, "Booshan" <santhi.boos...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > JS for replace and remove looks like this... > > > > $(''d1'').replace( "<div id=''d1''>Some Data</div>"); > > > > $(''d1'').remove(); > > You''ll have to try harder: > > <script type="text/javascript" src="prototype.js"></script> > > <div id="d1">d1</div> > <div id="d2">d2</div> > <div id="d3">d3</div> > <div id="d4">d4</div> > > <button onclick=" > $(''d1'').replace( ''<div id=d1>Some Data</div>''); > $(''d1'').remove(); > ">Replace & remove d1</button> > > Works fine in Prototype.js 1.5. > > -- > Rob > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 wouldn''t be surprised if the fact that you are removing and adding an element with the same id be the cause of your trouble in IE. I generally avoid doing this, as it often has some impredictable effects. On Mar 6, 10:16 pm, "RobG" <r...-AFFH1GffN5hPR4JQBCEnsQ@public.gmane.org> wrote:> On Mar 7, 5:53 am, "Booshan" <santhi.boos...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > JS for replace and remove looks like this... > > > $(''d1'').replace( "<div id=''d1''>Some Data</div>"); > > > $(''d1'').remove(); > > You''ll have to try harder: > > <script type="text/javascript" src="prototype.js"></script> > > <div id="d1">d1</div> > <div id="d2">d2</div> > <div id="d3">d3</div> > <div id="d4">d4</div> > > <button onclick=" > $(''d1'').replace( ''<div id=d1>Some Data</div>''); > $(''d1'').remove(); > ">Replace & remove d1</button> > > Works fine in Prototype.js 1.5. > > -- > Rob--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Deco Rior a écrit :> Is there an easy way to change the i-bar on the autocomplete to a > pointer?Grab the CSS rule for the element(s) you''re targeting, then add: cursor: default; -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2007-Mar-07 07:53 UTC
Re: remove and replace doesn''t work well in IE
Hey all, Aside from the fact that the minimalistic code works fine, I wonder why the OP uses: <div id="d1">...</div> $(''d1'').replace(''<div id="d1">Some data</div>''); instead of: $(''d1'').update(''Some data''); Which is less DOM-troubling on the d1 reference (and less risky on MSIE, maybe...). -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---