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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:12:44+00:00 2026-06-05T17:12:44+00:00

I have an array that looks like this: [ Object actions: Array[2] comments: Object

  • 0

I have an array that looks like this:

[
    Object
        actions: Array[2]
        comments: Object
        created_time: "2012-06-14T17:45:34+0000"
        from: Object
        id: "2388163605_10150972634368606"
        message: "På jakt efter lift Visby/oskarshamn- Malmö efter almedalsveckan antingen söndagen den 8 juli eller morgon/fm den 9 Juli... Bensinpengar och choklad utlovas... spännande historier kan berättas på begäran."
        to: Object
        type: "status"
        updated_time: "2012-06-14T21:45:15+0000"
        __proto__: Object
    , 
    Object
        actions: Array[2]
        comments: Object
        created_time: "2012-06-14T17:45:34+0000"
        from: Object
        id: "2388163605_10150972634368606"
        message: "På jakt efter lift Visby/oskarshamn- Malmö efter almedalsveckan antingen söndagen den 8 juli eller morgon/fm den 9 Juli... Bensinpengar och choklad utlovas... spännande historier kan berättas på begäran."
        to: Object
        type: "status"
        updated_time: "2012-06-14T21:45:15+0000"
        __proto__: Object
    , 
    Object
        actions: Array[2]
        comments: Object
        created_time: "2012-06-13T11:30:35+0000"
        from: Object
        id: "2388163605_10150969775613606"
        message: "Har en båtbiljett Nynäshamn-Visby avg 11.05 nu på fredag!"
        to: Object
        type: "status"
        updated_time: "2012-06-13T11:30:35+0000"
        __proto__: Object
    , 
    Object
        actions: Array[2]
        comments: Object
        created_time: "2012-05-21T10:36:18+0000"
        from: Object
        id: "103138046395999_394844430558691"
        message: "Hej, är det någon som pendlar Visby-Sthlm-Visby? Jag skulle behöva ha hjälp att få hem en byrå från Sthlm. Den är monterad så den där ganska stor. Så behövs släp,lastbil eller större personbil. Mvh Sabina "
        to: Object
        type: "status"
        updated_time: "2012-05-21T10:36:18+0000"
        __proto__: Object
]

I try to itterate and print out every message using mustache. This is the template i try to use:

<ul>
    {{#.}}
         <li>{{message}}</li>
    {{/.}}
</ul>

This is how I post the array into the template:

var template = $('#trips').html();
var content = locationIndex[loc.title];
var html = Mustache.to_html(template, content);
$('#right').html(html);

the template is defined like this:

<script id="trips" type="text/template">
    <div id="wrapper">
        <ul>
            {{#.}}
            <li>{{message}}</li>
            {{/.}}
        </ul>
    </div>
</script>

This is a method I’ve used before, and it seems to work now aswell…

The template works, because the Ul-tag is rendered, but I don’t seem to reference the array properly. What am I doing wrong?

  • 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-05T17:12:46+00:00Added an answer on June 5, 2026 at 5:12 pm

    Try this:

    Template:

    <script id="trips" type="text/template">
        <div id="wrapper">
            <ul>
                {{#array}}
                <li>{{message}}</li>
                {{/array}}
            </ul>
        </div>
    </script>
    

    JavaScript:

    var html = Mustache.to_html( template, { array: content } );
    

    I’m assuming that the content variable contains an array.

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

Sidebar

Related Questions

I have an object that looks like this when outputted via a print_r Array
I have a vardump that looks like this: Array ( [0] => stdClass Object
I have a array that looks like this Array ( [provider] => Array (
I have an array that looks like this: Array ( [0] => Array (
I have an array that looks like this, Array ( [0] => 849710414 [1]
I have an Array that looks like this: array( 0 => array( 'key1' =>
I have an array that looks like this (sample): Array ( [1600] => Array
I have an array that looks like this Array ( [0] => Array (
Hi I have an array that looks like this : Array ( [0] =>
In PHP I have an array that looks like this: $array[0]['width'] = '100'; $array[0]['height']

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.