Question

Im trying to append an img right after a piece of text. Im using 'embedly' to load news items, so I have to perform on window load. Its really simple: JsFiddle

I cant figure out why its not working. I have tried many combinations and events(after,Insert etc) nothing seems to work.

Was it helpful?

Solution

You should use .after method.

$('.embed').find('.description').after('<img src="http://latitudes.nu/wp-content/themes/theme-framework/framework/media/images/comment_icon.gif" style="width:14px; height:14px; border:none;" />');

A fix to your demo.

But, use setTimeout is not a good idea, you should set the callback option as the plugin provide.

OTHER TIPS

$("#element").append("<img src=\"image\">");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top