* Thomas Fuchs wrote (25/09/06 11:49):
> Be sure to use
> 
> $(DOMElement).update(blah)
> 
> instead of
> 
> DOMElement.innerHTML = blah
> 
> Prototype has built-in workarounds for issues with IE and table-based  
> elements,
> and there might be other stuff in the future. With .update() you can  
> feel a bit safer
> here.

In my version of prototype, it looks like I need to do
Element.update(DOMElement,blah)
rather than what's suggested above. Thanks for the tip.

Chris

> 
> Best,
> Thomas
> 
> Am 25.09.2006 um 12:21 schrieb Chris Lear:
> 
>>
>> * Siegfried Puchbauer wrote (25/09/06 10:28):
>>> oops, small typo ;)
>>>
>>> it should be:
>>> DOMElement.innerHTML =
>>> text.replace(/\n/g, "[br]").escapeHTML().replace("/\[br\]/g", "<br/ 
>>> >");
>>
>> Yes, that would work OK, as long as nobody enters "[br]" into the text
>> box. But it does an extra needless replace operation, and isn't robust
>> (replaces text that might be wanted).
>>
>> Here's what I'm using now:
>>
>> text.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/ 
>> g,"&gt;").replace(/\n/g,"<br/>");
>>
>> I have a feeling I can get away with only replacing one set of angle
>> brackets, like this:
>>
>> text.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\n/g,"<br/ 
>> >");
>>
>> This is presumably the normal way that people without prototype escape
>> their html, and I don't like it much. I'd be much happier if IE didn't
>> destroy newlines in the prototype .escapeHTML function. If anyone can
>> come up with a fix/workaround for that, I'd be interested.
>>

--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs
-~----------~----~----~----~------~----~------~--~---

Reply via email to