This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
5
How do I parse elements only once, (children load)
Post Body
On imgur, I am loading images inline. Top level comments work. Children are not loaded.
But if I click 'expand', I end up inlining top level again(So there's a duplicate), and the children (correctly)
Should I flag posts that have been parsed, so I don't modify them twice? Or is it better to see if a img
child exists?
My (working, but duplicates) function is:
function inlineImages() {
// loads images inline
var $imageUrls = $(".image-link");
$imageUrls.each(function(){
var $parent = $(this).parent().parent();
var url = $(this).text();
$parent.append("<br/><img src='" url "' style='width:auto; height:auto;' />");
});
}
Post Details
We try to extract some basic information from the post title. This is not
always successful or accurate, please use your best judgement and compare
these values to the post title and body for confirmation.
- Posted
- 10 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/jquery/comm...