this code: var test = document.createElement(''div''); test.innerHTML = "<div>this is a test<br />with a new line</div>"; test = Element.extend(test); alert(test.down(''div'').innerHTML); returns ''this is a test<BR>with a new line'' it changes the valid ''<br/>'' to the invalid ''<BR>'' im using IE7 are there any fixes for this? is it a browser issue or a prototype issue? thanks, -ollie --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
ollie wrote:> this code: > > var test = document.createElement(''div''); > test.innerHTML = "<div>this is a test<br />with a new line</div>"; > test = Element.extend(test); > alert(test.down(''div'').innerHTML); > > returns ''this is a test<BR>with a new line'' > > it changes the valid ''<br/>'' to the invalid ''<BR>''Are you sure it''s down() that''s causing problems? What does this say: var test = document.createElement(''div''); test.innerHTML = "<div>this is a test<br />with a new line</div>"; alert(test.innerHTML); -- Michael Peters Developer Plus Three, LP --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
thanks for the reply the code does return invalid xhtml in both firefox and IE7. i have managed to get round it by avoiding the use of innerhtml. thanks, -ollie On 17 May, 14:20, Michael Peters <mpet...-aUYv5hkjw45l57MIdRCFDg@public.gmane.org> wrote:> ollie wrote: > > this code: > > > var test = document.createElement(''div''); > > test.innerHTML = "<div>this is a test<br />with a new line</div>"; > > test = Element.extend(test); > > alert(test.down(''div'').innerHTML); > > > returns ''this is a test<BR>with a new line'' > > > it changes the valid ''<br/>'' to the invalid ''<BR>'' > > Are you sure it''s down() that''s causing problems? What does this say: > > var test = document.createElement(''div''); > test.innerHTML = "<div>this is a test<br />with a new line</div>"; > alert(test.innerHTML); > > -- > Michael Peters > Developer > Plus Three, LP--~--~---------~--~----~------------~-------~--~----~ 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 guess thats why they call it innerHTML and not innerXHTML ;-) On 12 Jun, 15:53, ollie <ollie.harri...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> thanks for the reply > > the code does return invalid xhtml in both firefox and IE7. i have > managed to get round it by avoiding the use of innerhtml. > > thanks, > -ollie > > On 17 May, 14:20, Michael Peters <mpet...-aUYv5hkjw45l57MIdRCFDg@public.gmane.org> wrote: > > > > > ollie wrote: > > > this code: > > > > var test = document.createElement(''div''); > > > test.innerHTML = "<div>this is a test<br />with a new line</div>"; > > > test = Element.extend(test); > > > alert(test.down(''div'').innerHTML); > > > > returns ''this is a test<BR>with a new line'' > > > > it changes the valid ''<br/>'' to the invalid ''<BR>'' > > > Are you sure it''s down() that''s causing problems? What does this say: > > > var test = document.createElement(''div''); > > test.innerHTML = "<div>this is a test<br />with a new line</div>"; > > alert(test.innerHTML); > > > -- > > Michael Peters > > Developer > > Plus Three, LP- Hide quoted text - > > - Show quoted text ---~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---