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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:54:31+00:00 2026-05-31T22:54:31+00:00

In Jquery Template website they gave this example.( http://api.jquery.com/jQuery.template/ ) <script> var movies =

  • 0

In Jquery Template website they gave this example.(http://api.jquery.com/jQuery.template/)

<script>
    var movies = [
        { Name: "The Red Violin", ReleaseYear: "1998", Director: "François Girard" },
        { Name: "Eyes Wide Shut", ReleaseYear: "1999", Director: "Stanley Kubrick" },
        { Name: "The Inheritance", ReleaseYear: "1976", Director: "Mauro Bolognini" }
    ];

    var markup = "<tr><td colspan='2'>${Name}</td><td>Released: ${ReleaseYear}</td><td>Director: ${Director}</td></tr>"

    /* Compile markup string as a named template */
    $.template( "movieTemplate", markup );

    /* Render the named template */
    $( "#showBtn" ).click( function() {
        $( "#movieList" ).empty();
        $.tmpl( "movieTemplate", movies ).appendTo( "#movieList" );
    });
</script>

My only question is how do i create this

var movies = [
    { Name: "The Red Violin", ReleaseYear: "1998", Director: "François Girard" },
    { Name: "Eyes Wide Shut", ReleaseYear: "1999", Director: "Stanley Kubrick" },
    { Name: "The Inheritance", ReleaseYear: "1976", Director: "Mauro Bolognini" }
];

data dynamically using a for loop? I tried creating this structure using a loop[very dirty way] and it didnt worked(probably because what i created was a similar looking string) and i guess its expects an array.

  • 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-31T22:54:32+00:00Added an answer on May 31, 2026 at 10:54 pm

    This is an JSON Object Array.

    myArray.push({name: depName, value: depValue});
    

    with push you are able to add new Elements. Read your data from somewhere and insert it into your array.

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

Sidebar

Related Questions

In this link: http://css-tricks.com/snippets/jquery/jquery-plugin-template/ it has a line of code that says // Add
For jQuery template: http://api.jquery.com/category/plugins/templates/ I want to be able to dynamically load the templates
After loading a PHP template (using jQuery's load function), this simple script won't make
I have the following KnockoutJS template (render with jquery.tmpl): <script id=contactsTemplate type=text/html> <li data-bind=click:
I'm using Jquery ui on my university's website but they are using Serena Collage
I just purchased a website template from DreamTemplate.com, and have tried to send a
Here is my website. http://ziggymonster.com/ At first it was having 4 torjan infected js
symfony: http://www.symfony-project.org pjax: https://github.com/defunkt/jquery-pjax Hi all, I'm trying to use pjax in symfony in
I want to perform an if check with in jquery template: jquery template <script
I've been using the following jquery template as a step by step form for

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.