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 8292299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:25:42+00:00 2026-06-08T13:25:42+00:00

I am looking to insert html (listItems) at a div layer with id LogInsert

  • 0

I am looking to insert html (listItems) at a div layer with id “LogInsert” using JQuery which accesses a cookie (LogSum) containing an array of key/value pairs. Some of the items out of the array cookie need to be combined with the inserted html into the DOM.

I have the following function script that errors, which is called on various events:

      function SetLogSum() {
      var listItems = "";
      var Cooksplit = $.cookie('logSum').split(',');

      $.each(Cooksplit, function(key, val) {
      listItems += "<div class='loggedinDetail'>" +
        "<div class='loggedinImage'>" +
        "<img src=" + val.uPic + " alt=" + val.uFName + val.uLName + " /></div>" +
        "<div class='loggedinName'><span>" + val.uFName + "</span></div>" +
        "<div class='loggedinStatus'><span>" + val.uGroup + " • " + val.uContRev + "</span></div>" +
        "</div>" +
        "<div class='loggedinHistory'>" +
        "<div class='loggedinReviewCount' title='Reviews'><span>" + val.CntRev + " Reviews</span></div>" +
        "<div class='loggedinTripCount' title=''><span>" + val.CntBook + "</span></div>" +
        "</div>";
    }
    );
    $("#LogInsert").html(listItems);
    }

The logSum cookie holds information such as:

uPic=avatar-male&uContRev=Contributor&uName=thedon&uGroup=Admin&uOP=0&uOA=0&uOH=0&uOI=0&uV=1&uP=0&uRv=0&uF=0&uCb=1&uPEC=0&uS=0&uC=UK&uL=en-US&uFName=Martin&uLName=Sansone&CntRev=6&CntBook=2

I know that the listItems part works and the .html insert as I use the same structure regularly in AJAX calls. So my problem is how Im handling the cookie but I don’t know why. Any ideas ?

  • 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-08T13:25:44+00:00Added an answer on June 8, 2026 at 1:25 pm

    You can convert:

    valueStr = "uPic=avatar-male&uContRev=Contributor&uName=thedon&uGroup=Admin&uOP=0&uOA=0&uOH=0&uOI=0&uV=1&uP=0&uRv=0&uF=0&uCb=1&uPEC=0&uS=0&uC=UK&uL=en-US&uFName=Martin&uLName=Sansone&CntRev=6&CntBook=2"
    

    string to an Object, where keys are uPic,uContRev,uName, etc… and values are avatar-male,Contributor,thedon, etc… like this:

    var val = JSON.parse( '{"'+
                              valueStr.replace(/=/g,'":"')
                              .replace(/&/g,'","') + 
                           '"}');
    

    then do like this:

    listItems += "<div class='loggedinDetail'>" +
        "<div class='loggedinImage'>" +
        "<img src=" + val.uPic + " alt=" + val.uFName + val.uLName + " /></div>" +
        "<div class='loggedinName'><span>" + val.uFName + "</span></div>" +
        "<div class='loggedinStatus'><span>" + val.uGroup + " • " + val.uContRev + "</span></div>" +
        "</div>" +
        "<div class='loggedinHistory'>" +
        "<div class='loggedinReviewCount' title='Reviews'><span>" + val.CntRev + " Reviews</span></div>" +
        "<div class='loggedinTripCount' title=''><span>" + val.CntBook + "</span></div>" +
        "</div>";
    

    DEMO

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was looking at adding rows dynamically to my HTML table using jQuery with
I'm looking for a method to insert a string, which contains HTML data, into
I'm looking to create a table in html to be used to insert the
I'm looking for a way to map a simple insert stored procedure using NHibernate
I'm looking for a way to insert a <style> tag into an HTML page
We have an HTML page which displays a bunch of pretty bars using divs
I'm hand-maintaining an HTML document, and I'm looking for a way to automatically insert
How can I insert a piece of HTML Code (containing and ') into my
Looking for a HTML converter which will produce valid XHTML code. One important thing
I am looking to insert data from a PHP form in to an XML

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.