<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sean&#039;s Blog &#187; js</title>
	<atom:link href="http://seanbehan.com/tag/js/feed/" rel="self" type="application/rss+xml" />
	<link>http://seanbehan.com</link>
	<description>Web Programming, Ruby on Rails, Wordpress, PHP from Burlington, Vermont</description>
	<lastBuildDate>Wed, 18 Jan 2012 21:44:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Parse for Links with Prototype JS</title>
		<link>http://seanbehan.com/programming/parse-for-links-with-prototype-js/</link>
		<comments>http://seanbehan.com/programming/parse-for-links-with-prototype-js/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 15:23:06 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[parse]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[view]]></category>

		<guid isPermaLink="false">http://bseanvt.wordpress.com/?p=79</guid>
		<description><![CDATA[Parsing for links with the Prototype javascript library is easy. Here is the pattern for finding links /(http&#124;https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^ =%&#38;amp;amp;:/~\+#]*[\w\-\@?^=%&#38;amp;amp;/~\+#])?/ And to implement it you can loop through your containers that might contain links document.observe(&#34;dom:loaded&#34;, function(){ var posts = $$(&#34;div#posts&#34;); for(var i = 0; i &#38;lt; posts.length; i++){ var link_regex = /(http&#124;https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^ =%&#38;amp;amp;:/~\+#]*[\w\-\@?^=%&#38;amp;amp;/~\+#])?/; var parsed_string = [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Fprogramming%2Fparse-for-links-with-prototype-js%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Parse for Links with Prototype JS" data-url="http://seanbehan.com/programming/parse-for-links-with-prototype-js/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>Parsing for links with the Prototype javascript library is easy. Here is the pattern for finding links</p>
<pre class="wp-code-highlight prettyprint">
/(http|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^
=%&amp;amp;amp;:/~\+#]*[\w\-\@?^=%&amp;amp;amp;/~\+#])?/
</pre>
<p>And to implement it you can loop through your containers that might contain links</p>
<pre class="wp-code-highlight prettyprint">
document.observe(&quot;dom:loaded&quot;, function(){
var posts = $$(&quot;div#posts&quot;);
for(var i = 0; i &amp;lt; posts.length; i++){
var link_regex = /(http|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^
=%&amp;amp;amp;:/~\+#]*[\w\-\@?^=%&amp;amp;amp;/~\+#])?/;
var parsed_string = posts[i].innerHTML.gsub(link_regex, '&amp;lt;a href=&quot;#{0}&quot;
target=&quot;_blank&quot;&amp;gt;#{0}&amp;lt;/a&amp;gt;');
posts[i].innerHTML = parsed_string;
}
});
</pre>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/programming/parse-for-links-with-prototype-js/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

