Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9003615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:44:05+00:00 2026-06-16T00:44:05+00:00

I have a lot of dynamically loaded content, for some reason Images are doing

  • 0

I have a lot of dynamically loaded content, for some reason Images are doing great, but Links and Text are not.

Here is a JSFiddle with the issue: http://jsfiddle.net/HRs3u/1/

I am guessing it has something to do with the text caching or not caching?

Here is the append section of the code:

function findpost(timestamp, blog){
    //console.log(blog);
    var length = blog.length;
    for(var e=0; e<length; e++){
        var type = blog[e+1];
        if(timestamp === blog[e]){
            if(type === 0){
                $("#content").append("\
                    <div class='post photo'>\
                    <img src='"+blog[e+2]+"' width='400px'/>\
                    </div>"
                );
            } else if(type === 1){
                $("#content").append("\
                    <div class='post video'>\
                    "+blog[e+2]+"<br>\
                    "+blog[e+3]+"\
                    </div>"
                );
                console.log("Video");
            } else if(type === 2){
                $("#content").append("\
                    <div class='post link' />\
                    <a href='"+blog[e+2]+"' target='_blank'>"+blog[e+3]+"</a>\
                    </div>\
                ");
                console.log("Link!");
            } else if(type === 3){
                var title = blog[e+3];
                var text = blog[e+2];
                $("#content").append("\
                    <div class='post text' />\
                    <h2>"+title+"</h2>\
                    "+text+"\
                    </div>\
                ");
                console.log("Text!");
            } else if(type === 4){
                $("#content").append("\
                    <div class='post tweet' />\
                    "+blog[e+2]+"\
                    </div>\
                ");
                console.log("Tweet!");
            } else {
                console.warn("ERROR!");
            }
        }
    }
}

And the CSS:

/*___Post Divs*/
.post{
    display     : inline-block;
    float       : left;
    line-height : 0;
    margin      : 5px;
    overflow    : hidden;

    border      : 1px solid #000;

    width       : 400px;
    height      : 400px;

}

.post.photo{
    background-color: #ccc;
}

.post.video{
    background-color: #0f1;
}

.post.link{
    background-color: #ff4;
}

.post.text{
    background-color: #c0f;
}

.post.tweet{
    background-color: #f44;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:44:05+00:00Added an answer on June 16, 2026 at 12:44 am

    It’s because in some of the append method, you’re closing the div beforehand. Check the script where type equals 2, 3 & 4.

    function findpost(timestamp, blog){
        //console.log(blog);
        var length = blog.length;
        for(var e=0; e<length; e++){
            var type = blog[e+1];
            if(timestamp === blog[e]){
                if(type === 0){
                    $("#content").append("\
                        <div id='post' class='photo'>\
                        <img src='"+blog[e+2]+"' width='400px'/>\
                        </div>"
                    );
                } else if(type === 1){
                    $("#content").append("\
                        <div id='post' class='video'>\
                        "+blog[e+2]+"<br>\
                        "+blog[e+3]+"\
                        </div>"
                    );
                    console.log("Video");
                } else if(type === 2){
                    $("#content").append("\
                        <div id='post' class='link'>\ 
                        <a href='"+blog[e+2]+"' target='_blank'>"+blog[e+3]+"</a>\
                        </div>\
                    ");
                    console.log("Link!");
                } else if(type === 3){
                    var title = blog[e+3];
                    var text = blog[e+2];
                    $("#content").append("\
                        <div id='post' class='text'>\
                        <h2>"+title+"</h2>\
                        "+text+"\
                        </div>\
                    ");
                    console.log("Text!");
                } else if(type === 4){
                    $("#content").append("\
                        <div id='post' class='tweet'>\
                        "+blog[e+2]+"\
                        </div>\
                    ");
                    console.log("Tweet!");
                } else {
                    console.warn("ERROR!");
                }
            }
        }
    }​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a project using jQuery and a lot of dynamically-generated content. There is
Here is a JSFiddle for ease: http://jsfiddle.net/u5XmR/ I have a lot going on, but
I have run into a strange problem, i am creating a lot of dynamically
Hi I have the following code (I've removed some of the bloat, but everything
I have a chart in WPF with a lot of labels. The text on
I need to add onclick event to some dynamically added button , but when
I am trying to check if the elements that are loaded dynamically have complete
How can I target dynamically loaded content with jQuery? I've read about it a
I have a page with a lot of dynamically generated check boxes on it.
Some of my pages have a lot of <%@ Register directives for controls that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.