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

  • Home
  • SEARCH
  • 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 6362631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:56:02+00:00 2026-05-24T23:56:02+00:00

I am working on a project in Google Blogger. First i want to explain

  • 0

I am working on a project in Google Blogger. First i want to explain a thing.

In blogger every post that is created has a unique id assigned to it by blogger itself. This id can be retrieved using Blogger JSON. So i have retrieved the ids of four recent posts using JSON.

I want to wrap these first four id containers around a DIV container using JQuery or Javascript.

The problem is when i use these ids absolutely in the selector $ and use the wrapAll() function the id container’s gets wrapped up.

But as i said i’m using JSON to get the container id’s so the values of ID’s are stored in variable’s and when i use those variable as selection for wrapAll() function it doesn’t work.

I have demos of both those situation’s which can be seen by going to this blog http://youblog-demo.blogspot.com/ and using the firebug console to run these code.

Situation 1 when i use absolute container ids

var script = document.createElement("script");
script.src = "http://youblog-demo.blogspot.com/feeds/posts/default?alt=json&callback=hello";
document.body.appendChild(script);
function hello(json){
if(json.feed.entry.length>4){
var post_num=4;
var id_coll = new Array();
for(i=0; i<post_num; i++){
    var ids = json.feed.entry[i].id.$t;
    var post_id = ids.substring(ids.indexOf("post-"));
    var only_id = post_id.substring(5);
    id_coll[i] = only_id;
}
$("#3337831342896423186,#123892177945256656,#9095347670334802803,#2525451832509945787").wrapAll('<div>');
}
};

Situation 2 when i use variable’s to select the containers

var script = document.createElement("script");
script.src = "http://youblog-demo.blogspot.com/feeds/posts/default?alt=json&callback=hello";
document.body.appendChild(script);
function hello(json){
if(json.feed.entry.length>4){
    var post_num=4;
    var id_coll = new Array();
    var front_name = "#";
    for(i=0; i<post_num; i++){
        var ids = json.feed.entry[i].id.$t;
        var post_id = ids.substring(ids.indexOf("post-"));
        var only_id = post_id.substring(5);
        id_coll[i] = only_id;
    }
var joined_id_0 = String.concat(front_name,id_coll[0]);
var joined_id_1 = String.concat(front_name,id_coll[1]);
var joined_id_2 = String.concat(front_name,id_coll[2]);
var joined_id_3 = String.concat(front_name,id_coll[3]);
$(joined_id_0,joined_id_1,joined_id_2,joined_id_3).wrapAll('<div>');
}
};

So when i use the situation 2 code then it doesn’t work but the situation1 code works fine. Can anybody help me with this

  • 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-05-24T23:56:03+00:00Added an answer on May 24, 2026 at 11:56 pm

    You have to concatenat the ids, separated by a comma, as in #id1, #id2, ....

    You can do that this way:

    [joined_id_0,joined_id_1,joined_id_2,joined_id_3].join(',')
    

    The whole line:

    $([joined_id_0,joined_id_1,joined_id_2,joined_id_3].join(',')).wrapAll('<div>');
    

    If it doesn’t works, check the what is returned by [joined_id_0,joined_id_1,joined_id_2,joined_id_3].join(',') (alert() it, or use console.log).

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

Sidebar

Related Questions

I'm working on a django-nonrel project running on Google's AppEngine. I want to create
Working a on a Google Web Toolkit project. I want to show a word
I'm working on a project here that will store some info in Google Analytics
I am working on a project that wants me to get information from Google
I am currently working on a project that uses a Google Earth API library
I'm working on a project using Google Maps v3 that will allow users to
I'm working on a project that generates Google Earth KML files and saves the
I just started working on a project that will run on google app engine
I'm currently working on a project that is done in Java, on google appengine.
I am working on a project that uses google proto buffers for internal data

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.