On Apr 23, 2007, at 12:09 PM, tobie wrote:

> you cannot use single quotes around attributes in HTML.

'Tis not so:
"... attribute values be delimited using either double quotation  
marks (ASCII decimal 34) or single quotation marks (ASCII decimal  
39)... .
"In certain cases, authors may specify the value of an attribute  
without any quotation marks." [1]

[1] http://www.w3.org/TR/html401/intro/sgmltut.html#h-3.2.2

> On Apr 23, 2:06 pm, "Steve T." <[EMAIL PROTECTED]> wrote:
>> 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 />.

Steve: As you point out, Firefox "normalizes" text it parses when  
creating its internal DOM tree. The HTML 4.01 spec says the attribute  
of href must be of type URI [2] [3], which is likely why Firefox  
changes the value--it's an effort to be standards compliant.

[2] http://www.w3.org/TR/html401/struct/links.html#h-12.2
[3] http://www.ietf.org/rfc/rfc2396.txt


TAG

>
>
> >


--~--~---------~--~----~------------~-------~--~----~
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