1

I am working on a project and I want to show the api fetched results in this div.

Now I have to set the restful api fetched value to this div in exactly the same design.

Please suggest how do I do this ? This is the bus api field and I want to the result in a ul li field .

Can I append this?

   <div class="details col-xs-9 clearfix">
     <div class="col-sm-8">
       <div class="clearfix">
         <h4 class="box-title">Economy Car<small>bmw mini</small></h4>
         <div class="logo">
           <img src="http://placehold.it/110x25" alt="" />
         </div>
       </div>
       <div class="amenities">
         <ul>
           <li><i class="soap-icon-user circle"></i>4</li>
           <li><i class="soap-icon-suitcase circle"></i>3</li>
         </ul>
       </div>
     </div>
     <div class="col-xs-6 col-sm-2 character">
       <dl class="">
         <dt class="skin-color">Location</dt><dd>London city</dd>
       </dl>
     </div>
     <div class="action col-xs-6 col-sm-2">
       <span class="price"><small>per day</small>$45.39</span>
       <a href="car-detailed.html" class="button btn-small full-width">select</a>
     </div>
   </div>
 </article>

Rob Baillie
  • 3,436
  • 2
  • 20
  • 34
Travelers
  • 67
  • 9
  • you can refer to [this] (http://stackoverflow.com/questions/1145208/jquery-how-to-add-li-in-an-existing-ul) – Pranav Nov 24 '14 at 07:44

1 Answers1

0

first thing - please edit your question and make more readable.

Guide to answer [from what I understood] :

All you need to do is loop over your data and create nodes and append it to the correct DOM element. please refer this

  1. Give id/name to your "ul" tag in html
  2. Create element using tagname="li"
  3. Append it to the "ul".
  4. Loop through step 2 and 3

Also, Please let us know your response from server so that we can guide you better.

Pranav
  • 2,054
  • 4
  • 27
  • 34