Ok, so here's the skinny...
I've worked out a jQuery function that will first look at the page and search for <cite> tags. Then, it looks at the text contained within it and searches for a hyphen. If it finds one, then everything BEFORE the hyphen is used as the text within the tag. Whereas, everything AFTER the hyphen is used in an onlick event that opens a new window to that url.
Here's what it looks like:
// Custom function for <cite> tags making them clickable
$('cite:contains("-")').each(function(){
var split=$(this).html().match( /([\s\w]+)[\-](.+)$/i );
$(this).text(split[1]);
$(this).click(function(){
window.open( split[2] );
return false;
});
});
And here is how it's used:
<blockquote>
This is quoted text from some article somewhere on the web...
<cite>Source of Quote - http://quotedsitesource.com</cite>
</blockquote>
Now, I've got it working perfectly on a static page... See here: http://blatantwasteofspace.com/crapadoodledoo/cite-test.html
However, when I try to implement it as a script that's loaded up in a WordPress theme, it fails miserably! See here: http://blatantwasteofspace.com/at-random/quotes-time
I don't understand it... I mean, I'm loading the exact same version of jQuery. At first I thought it might be because I was using wp_enqueue_script('jquery') to load jQuery since it loads up the noconflict version... So, I removed that and just loaded the same version I'm loading in the static page, but still no dice.
Any ideas?