I have seen something really cool at Yippy
They are loading the url in to an iframe for a quick view. I would like to do the same for my website. I’m using the bing API, example: JsFiddle
So I appended an iframe and a div to trigger the load event:
<div class="blok"></div>
<iframe class="ifram" src="" width="100" height="100"></iframe>
And I tried this for the event:
$(".block").click(function () {
$(".ifram").attr("src", (".desc a", this).text() );
});
Doesn’t work.
There’s about 6 things wrong:
.click(), but the results are added dynamically, therefore you need to use a live handler such as.on().blokin the html, but you’re binding the event to.block.iframelement$in front of your selectorThe following code should do what you want:
jsFiddle: http://jsfiddle.net/aHCT5/18/