On Feb 5, 2008, at 3:10 PM, Walter Lee Davis wrote:

> In Safari 3, if I inspect the page, I can see that the correct
> JavaScript is coming back, but it's apparently not firing. I've tried
> all sorts of things, even very basic alerts, but they're not firing.
>
> The code that should be firing is in a script tag, and the
> Element.update documentation clearly states that any such code will
> be executed when the element is updated. And in Firefox, this seems
> to be the case.
>

A bit more troubleshooting has unlocked part of the mystery. The code  
I am inserting is a full <li>, and I am adding it into an UL. So my  
fragment looks like this:

<li><p>A comment, just made by the person using the form</p><p  
class="author">—Person's Name</p></li>

If I try to insert that using Safari, I get nothing -- no error --  
just nothing.

If I encode it in HTML entities, then it inserts, but of course  
displays as code -- not what I want.

If I encode it in HTML entities, then insert it with $ 
('reflist').insert({top:mycode.unescapeHTML()}), then it ALMOST works  
-- everything is fine except for the class="author" part, which  
Safari's Web Inspector shows as being coded as class=""author"" (and  
of course does not honor).

Through it all, Firefox is a good soldier, and does what I want.

It seems as though the whole problem is with escaping characters  
while passing the string to insert, but I'm completely baffled how to  
get this to work. Should I try JSON encoding the parameter? Or maybe  
build up the inserted LI from DOM objects?

Thanks in advance,

Walter


--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to