you cannot use single quotes around attributes in HTML.
Try it again with double quotes and see if you still have the weird
href escaping issue.
On Apr 23, 2:06 pm, "Steve T." <[EMAIL PROTECTED]> wrote:
> I'm using 1.5.1_rc2 with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-
> US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3.
>
> I suspect strongly that this is a quirk with innerHTML in Firefox, but
> I'm stumped and was hoping someone had a workaround.
>
> Given this code --
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
> <title>inner.html</title>
> <script type="text/javascript" src="js/prototype.js"></script>
>
> <script type="text/javascript">
> Event.observe(window, 'load',
> function() {
> alert($('xyz').innerHTML);
> }
> );
> </script>
> </head>
> <body>
> <div id='xyz'><a id='#{id}' href='#{id}'>ss#{id}ss</a><span
> id='#{id}'></span></div>
> </body>
> </html>
>
> I would expect the alert() to spit out *EXACTLY* what is inside the
> <div>. In fact that is what I get with IE7. However, with Firefox I
> get --
>
> <a id="#{id}" href="#%7Bid%7D">ss#{id}ss</a><span id="#{id"'></span>.
>
> Notice two things --
>
> (1) The attributes are now double-quoted instead of single-quoted. I
> don't think this is a big deal, but it's curious in any case.
>
> (2) The original href='#{id}' now has the { and } encoded. That
> causes a problem when I try to use this string in a Prototype
> Template. I've been fooling around with this a bit and the only
> attribute on any HTML element that I can find that does this is the
> href inside an <A />.
>
> Anyone know of a way around this?
>
> Thanks in advance!
> -Steve.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---