fettig.netBlog2002 → LINK Elements, Bookmarklets, and Case Sensitivity

LINK Elements, Bookmarklets, and Case Sensitivity

This morning I tried using my ‘Subscribe’ bookmarklet to add the RSS feed at tusugen.com to Hep. It didn’t work. A look at the source revealed that the link tag looks like this:


<link REL="ALTERNATE" TYPE="application/rss+xml" 

TITLE="RSS" HREF="http://tesugen.com/index.xml">

The bookmarklet is looking for a LINK elements whose REL is “alternate”, and so it fails to find one whose REL is “ALTERNATE”.

I’m not sure what the official spec says on case-sensitivity in attribute values, but according to this page the REL attribute should not be case sensitive. So I modified my bookmarklet (and the one in the Hep docs) to convert attribute values to lower case before comparing them (using the toLowerCase() method of javascript strings).

The updated bookmarklet is here:

Subscribe

(I also sent an e-mail to Mark, who created the original Subscribe bookmarklets).

Comments are closed.