Extracting img from url - Script works in jsfiddle, but not on my site, can anyone spot the reason why?
<p>Disclaimer:  I'm about green as they get working with javascript:</p>

<p>So anyway, after much trial and error, and probably butchering this code, I've finally managed to enable auto embedding of media on my forum.  I'm using oembed, and then a script for images and attachments.  One problem though:</p>

<p><a href="http://jsfiddle.net/khb8g6e3/" rel="nofollow">http://jsfiddle.net/khb8g6e3/</a></p>

<p>This one works on jsfiddle, but not on my site (using the same source code)
Here's the source
(not enough reputation points to post link, I'll try to add after).</p>

<p>My first attempt was this:</p>

<p><a href="http://jsfiddle.net/edhg1zu0/" rel="nofollow">http://jsfiddle.net/edhg1zu0/</a></p>

<pre><code>$(document).ready(function () {
var href = $('a.postlink.img-link').get(0).href;
$('a.postlink.img-link').html($('&lt;img&gt;').attr('src', href));
$('a.postlink.img-link').colorbox({
        scalePhotos:'true',
        maxHeight:'99%',
        maxWidth:'99%',
        opacity:'0.75',
        fixed:true,
        photo:true
    });
</code></pre>

<p>})</p>

<p>Which works, but only shows one image over and over again.</p>

<p>I'd be happy with either code(whichever is easiest to fix), if someone could show me what I'm doing wrong.</p>