how do i do the following code (making urls clickable and images show) with jquery instead of dojo?
<p>i'm rewriting an userscript and replacing the use of dojo with jquery ,but then i came upon something.. and i got lost. :(</p>

<p>this is the script with dojo, it worked fine:</p>

<pre><code>dojo.query(".body").forEach(function(node, index, arr){
      kmfa.check(node,index);
});


kmfa.check = function(node){    //check for links/images and replace some stuff
   regex= /(https?:\/\/([-\wäöü\.]+)+(:\d+)?(\/([-=_\w\.\%\@\#\~;:,\(\)\/\+]*(\?[^&lt;&gt;\s]+)?)?)?)/gi;
   node.innerHTML = node.innerHTML.replace( /&lt;a[^&gt;]+&gt;([^&lt;]+)&lt;\/a&gt;/gi, '$1' );
   node.innerHTML = node.innerHTML.replace( /&lt;wbr&gt;/g, '' );
   if (node.innerHTML.indexOf('.png') != -1 || node.innerHTML.indexOf('.gif') != -1 ||  node.innerHTML.indexOf('.jpg') != -1 || node.innerHTML.indexOf('.tif') != -1 || node.innerHTML.indexOf('.bmp') != -1){
       node.innerHTML = node.innerHTML.replace( regex, '&lt;img src="$1" class="imgLimit" &gt;&lt;/br&gt;&lt;a href="$1"&gt;$1&lt;/a&gt;' );    
   }else{
       node.innerHTML = node.innerHTML.replace( regex, '&lt;a href="$1" target="_blank"&gt;$1&lt;/a&gt;' ); 
   }
}
</code></pre>

<p>now how do i get this to work with jquery?</p>

<p>all i got sofar is:</p>

<pre><code>$('#forum').each(function (ind){
    $(this).text(kmsi.replaceURLWithHTMLLinks($(this).text() ) )    
});

kmsi.replaceURLWithHTMLLinks = function(text) {
   var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&amp;@#\/%?=~_|!:,.;]*[-A-Z0-9+&amp;@#\/%=~_|])/ig;
   return text.replace(exp,"&lt;a href='$1'&gt;$1&lt;/a&gt;"); 
}
</code></pre>

<p>but that isn't working at all.</p>

<p>(i figure there will be comments like 'why change to jqeury when you have it working?'. to answer those beforehand: i just wanna learn jquery!)</p>

<p>any help is welcome, thanks!</p>
