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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:05:13+00:00 2026-06-11T10:05:13+00:00

Help, i want to do looping when the data is displayed to the div

  • 0

Help, i want to do looping when the data is displayed to the div tag as the following code :

function GetDataFromServer() {

var url = "http://bertho.web.id/curl/services21/DataReadNP.php";
JSONP.get(url, {}, function(response){
    var listItem, container, dataList = document.getElementById("dataList"), str = "", str2 = "";
            for ( var i = 0; i < response.length; ++i ) {
                str += response[i].title;
                str2 += response[i].fetch_date;
            }

    listItem = document.createElement('div');
    listItem.setAttribute('data-bb-type', 'item');
    listItem.setAttribute('data-bb-img', 'images/icons/icon11.png');
    listItem.setAttribute('data-bb-title', str);
    listItem.innerHTML = str2;

    container = document.createElement('div');
    container.appendChild(listItem);

    bb.imageList.apply([container]);

    dataList.appendChild(container.firstChild);

    if (bb.scroller) {
        bb.scroller.refresh();
    }

});  

}

To display the list to the screen :

function dataOnTheFly() {
   document.getElementById('waiting').style.display = 'none';
   GetDataFromServer()  
}

The data I want is displayed on the screen, but do not fit what I wanted.
Please see pictures below :

http://s13.postimage.org/68w2zfmh3/data_BB.png

I want to list this data looping until all the data on the server is taken.
How do I to get the results I want?

  • 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-11T10:05:14+00:00Added an answer on June 11, 2026 at 10:05 am

    Pulling up the URL given in your question, your data looks like this:

    "items": [
     {
      "id": "30",
      "judul": "KATY PERRY: PART OF ME",
      "img": "http:\/\/bertho.web.id\/curl\/21proses\/images\/r_134760931680781_100x147.jpg",
      "desk": "Sebuah dokumentasi tentang kehidupan Katy Perry diatas maupun diluar panggung. [More]",
      "web": "http:\/\/www.21cineplex.com\/",
      "fetch_date": "15-09-2012 20:10:23"
     }, 
    

    This is a JSON response, not a JSONP — they are similar, but different. I’m not sure what your JSONP function does, so I can’t tell you exactly how to proceed.

    At some point, you need to run JSON.parse() on the data you receive. Your library may nor may not do this for you. If typeof response === "string" then it hasn’t.

    Once you have the JSON decoded to an object, then it is just a simple matter of looping

    var items = response.items;
    var l = items.length;
    var i = 0;
    var item;
    
    for (i = 0; i < l; i++) {
      item = items[i];
      // Now you can do something with item
       listItem = document.createElement('div');
       listItem.setAttribute('data-bb-type', 'item');
       listItem.setAttribute('data-bb-img', item.img);
       listItem.setAttribute('data-bb-title', item.judul);
       // Don't forget to append listItem somewhere.
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want help on this script I am making... I want my website to
hey i guys i want help from you. i am working on website project,
I am in a learning way of mysql and want help to know where
I want to help user to take their pictures with a plugged in video
I'm a final year high school student and want to help my father secure
I want to implement a simple help form to appear once the application has
I want a program that would help me create virtual devices on a virtual
I want to show some help text(much like in a webpage when a field
I want to optimize images with the help of some external programs. The programs
I want to using Linq to help make a list of movies an actor

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.