Fotiman - 1:50 am on Mar 5, 2013 (gmt 0)
Without seeing what humour.js is doing, it's hard to say. Note, I tried a very simple example that still seemed to work:
<div id="myselector"><script>document.write('<a href="\/joke.php"><img src="\/images\/joke.gif" border="0" \/><\/a>');</script></div>
So without knowing what humour.js is doing, it's hard to guess. You should still be able to use browser developer tools to inspect the img and see if the markup looks like what you expect it to.