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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:16:52+00:00 2026-05-13T17:16:52+00:00

M(model): HTML, V(view): CSS, C(Controller): JavaScript Hi, I’m maintaining a personal bookshelf (a list

  • 0

M(model): HTML, V(view): CSS, C(Controller): JavaScript

Hi,

I’m maintaining a personal bookshelf (a list of books) in a simple static HTML document, ie:

<ul>
  <li class="book">Kitting tips and tricks</li>
  <li class="book">La Bonne Cuisine Of Madame E. Saint-Ange: The Essential Companion For Authentic French Cooking</li>
  <li class="book">Don't Make Me Think: A Common Sense Approach to Web Usability, 2nd Edition</li>
</ul>

Ok, this is for the model part: just books titles entries (DB equivalent)


Now for presentational purposes, I would like to present it a bit differently… For example, I prefer showing the book’s cover rather its title as simple text, eg:

<li class="book"><img alt="Kitting tips and tricks" src=""></li>

For this, I use a web-service (Google Books API) to fetch book’s information, client-side(JSON):

$('.book').each(function(index, book){
  $.getJSON("http://books.google.com/books/feeds/volumes?alt=json-in-script&callback=?",
    {q: $(book).text()},
    function(data, textStatus) {
      // DOM manipulations: replacing book's title by its cover image
      $(book).empty().html('<img alt="' + data.feed.entry[0].title.$t + '" src="' + (data.feed.entry[0].link[0].href) + '"/>');
    }
  );
})

The problem is DOM manipulations can rapidly becomes complex, for example, if I also want to add author, editor, reviews…

So my question is: is there a way to define a sort of template for the final rendering of the book, eg something like:

 <li class="book"><img src="{cover}" alt="{title}"> by <address class="vcard"><span class="fn">{author}</span></address>...</li>

and processing it(client-side) with the web-service’s result values?

It makes me think about XSLT here, but I’m really not sure about its implementation over javascript. Do you have another idea?

Thanks for your suggestions.

  • 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-13T17:16:53+00:00Added an answer on May 13, 2026 at 5:16 pm

    Have you looked at this StackOverflow question?

    JQuery templating engines

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

Sidebar

Related Questions

Afternoon all. I have a drop down list in my view <div class=editor-label> @Html.LabelFor(model
I've got the following ASP.NET 4 MVC 3 code in a view: @Html.TextBoxFor(model =>
Problems with wiring up datepicker The code for partial view @model System.DateTime @Html.TextBox(, Model.ToString(dd/MM/yy),
So let's say I have a view that access a date: <%= Html.TextBoxFor(model =>
I have this view @model IEnumerable<ViewModelRound2> ... <snip> ... @{ using (Html.BeginForm(new { round1Ring3Bids
In my view I have the following code: @using (Html.BeginForm()) { @Html.TextBox(Date2, Model.Date2) <br/>
in a partial view I have the following: <%Html.RenderAction(MVC.User.GetComments(Model.UserGroupName)); %> can I render a
I am rendering out a ViewUserControl (.ascx file) in a view: <% Html.RenderPartial(Comments, Model.Comments);
I have the following code in a view: <div class=wrap_select> @Html.DropDownList(dateRange, new SelectList(Model.DateRange, Value,Text),
I follow the MVC model in PHP + JS + HTML + CSS Also,

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.