RDF Metadata About: http://lojjic.net/blog/20040123-114122

Predicate:Object:
http://lojjic.net/ns/rdf/blog/entry-content

I've been fooling around a lot with XBL recently, and have converted my Accessible Email Obfuscation script into an XBL binding. Here's the binding, which would be saved as an XML file such as EmailLink.xml:

<?xml version="1.0"?>
<bindings xmlns="http://www.mozilla.org/xbl" xmlns:h="http://www.w3.org/1999/xhtml">
   <binding id="email-address">
      <implementation>
         <field name="email">
            var txt = this.firstChild;
            if(txt.nodeType!=3) txt=txt.firstChild; //if anon. content not supported
            txt.nodeValue.replace(/[ \[\{\(\|\/\\]at[ \]\}\)\|\/\\]/i, "@")
               .replace(/[ \[\{\(\|\/\\](dot|period|point)[ \]\}\)\|\/\\]/gi, ".");
         </field>
         <constructor>
            var lnk = document.getAnonymousNodes(this)[1];
            lnk.setAttribute("href", "mailto:"+this.email);
            lnk.firstChild.nodeValue = this.getAttribute("title") || this.email;
         </constructor>
      </implementation>
      <content>
         <h:span style="display:none"><children /></h:span>
         <h:a href="">-</h:a>
      </content>
   </binding>
</bindings>

Then in your HTML page you would insert the email address in obfuscated form:

<span class="mail">jj/at/lojjic\period\net</span>

And then you attach the XBL binding to that element using CSS:

.mail {-moz-binding:url(EmailLink.xml#email-address)}

The advantage of this approach is that you don't have to include any script in your page, and since it's attached using CSS you have the full power of CSS selectors for choosing which elements it applies to. Of course, it only works in Mozilla (for the time being...)

http://lojjic.net/ns/rdf/blog/entry-date2004-01-23T11:41:23-07:00
http://lojjic.net/ns/rdf/blog/entry-titleAccessible Email Obfuscation in XBL
http://lojjic.net/ns/rdf/comments/allow-commentstrue
http://lojjic.net/ns/rdf/comments/commentsAnonymous Resource (rdf:nodeID="node13fu3a1uux81"):
Predicate:Object:
http://www.w3.org/1999/02/22-rdf-syntax-ns#typehttp://lojjic.net/ns/rdf/comments/CommentList
http://www.w3.org/1999/02/22-rdf-syntax-ns#typehttp://www.w3.org/2000/01/rdf-schema#Resource
http://www.w3.org/1999/02/22-rdf-syntax-ns#typehttp://www.w3.org/1999/02/22-rdf-syntax-ns#Seq
http://www.w3.org/1999/02/22-rdf-syntax-ns#typehttp://www.w3.org/2000/01/rdf-schema#Container
http://www.w3.org/2000/01/rdf-schema#memberhttp://lojjic.net/blog/20040123-114122/comment-20040123-221152
http://www.w3.org/2000/01/rdf-schema#memberhttp://lojjic.net/blog/20040123-114122/comment-20040125-040404
http://www.w3.org/2000/01/rdf-schema#memberhttp://lojjic.net/blog/20040123-114122/comment-20040124-162224
http://www.w3.org/2000/01/rdf-schema#memberhttp://lojjic.net/blog/20040123-114122/comment-20040123-223921
http://www.w3.org/2000/01/rdf-schema#memberhttp://lojjic.net/blog/20040123-114122/comment-20051103-201638
http://www.w3.org/1999/02/22-rdf-syntax-ns#_1http://lojjic.net/blog/20040123-114122/comment-20040123-221152
http://www.w3.org/1999/02/22-rdf-syntax-ns#_2http://lojjic.net/blog/20040123-114122/comment-20040123-223921
http://www.w3.org/1999/02/22-rdf-syntax-ns#_3http://lojjic.net/blog/20040123-114122/comment-20040124-162224
http://www.w3.org/1999/02/22-rdf-syntax-ns#_4http://lojjic.net/blog/20040123-114122/comment-20040125-040404
http://www.w3.org/1999/02/22-rdf-syntax-ns#_5http://lojjic.net/blog/20040123-114122/comment-20051103-201638
http://purl.org/dc/terms/modified1139767943
http://www.w3.org/1999/02/22-rdf-syntax-ns#typehttp://lojjic.net/ns/rdf/blog/Entry
http://www.w3.org/1999/02/22-rdf-syntax-ns#typehttp://lojjic.net/ns/rdf/comments/CommentableResource
http://www.w3.org/1999/02/22-rdf-syntax-ns#typehttp://www.w3.org/2000/01/rdf-schema#Resource

RDF