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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:02:34+00:00 2026-05-31T09:02:34+00:00

all. I have a ajax and jquery-mobile loading question. api = update: -> console.log

  • 0

all. I have a ajax and jquery-mobile loading question.

  api = 
    update: ->
    console.log "updated"
    $.ajax
      dataType: "jsonp"
      url: "http://localhost:3004/videos.json"
      success: (data) =>
        if data
          data.forEach (elem) =>
            video_id = elem.video_id
            embed_id = elem._id
            $("#play_list").append "
            <ul data-role='listview' data-theme='a'>
              <li>hello</li>
              </ul>
             "
   t = api.update()

And I try to insert this code into html file.

  <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet"/>
  <link href="bootstrap/css/bootstrap.responsive.css" rel="stylesheet"/>
  <body>
   <div id="play_list"></div>
  </body>
<script>
 head.js(
 "lib/jquery.js",
 "lib/jquery.mobile-1.0.1.min.js",
 "http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.1.6/underscore-min.js", 
 "http://cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js", 
 "http://cdnjs.cloudflare.com/ajax/libs/backbone.js/0.9.1/backbone-min.js",
  "app.js"
 );
</script>
</html>

Outputted html code is

<ul data-role='listview' data-theme='a'>
 <li>hello</li>
</ul>

But it doesn’t formatted by jquery-mobile style . It just output normal html style.
I want to output like following picture http://brooky.cc/wp-content/uploads/2011/04/list_view1.png

Please help.

Thanks in advance.

  • 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-31T09:02:35+00:00Added an answer on May 31, 2026 at 9:02 am

    From the fine manual:

    Calling the listview plugin

    You can directly call the listview plugin on any selector, just like any jQuery plugin:

    $('#mylist').listview();
    

    The library automatically calls listview() on all the lists that are in the page when things start up, AFAIK it basically does this:

    $('[data-role=listview]').listview();
    

    If you add a new list, you just need to .listview() it:

    success: (data) =>
      if data
        data.forEach (elem) =>
          video_id = elem.video_id
          embed_id = elem._id
          ul = $("
            <ul data-role='listview' data-theme='a'>
              <li>hello</li>
            </ul>
          ")
          $("#play_list").append ul
          ul.listview()
    

    Demo: http://jsfiddle.net/ambiguous/pMF4G/

    You could also add them all at once:

    success: (data) =>
      if data
        uls = $()
        data.forEach (elem) =>
          video_id = elem.video_id
          embed_id = elem._id
          uls = uls.push("
            <ul data-role='listview' data-theme='a'>
              <li>hello</li>
            </ul>
          ")
        $("#play_list").append uls
        uls.listview()
    

    Demo: http://jsfiddle.net/ambiguous/BdqeC/

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

Sidebar

Related Questions

I have a strange error where my jquery ajax request doesn't submit all the
I have a few pages made with jquery mobile. These pages are all separate
I have jQuery.ajax() creating a request to a url (cms2/docman/dir/%id) (%id is a numeric
I finally have jQuery AJAX down pretty well and have my website all created,
I have jquery ajax() function: $.ajax({ type: POST, url: 'ajax.php', data: 'url='+variable, success: function(data){
I have an ajax call (JSONP) using JQuery with GET method. I think because
I have the code below loading into a jquery mobile page data-role. Two strange
I used to have a simple ajax that helped me take all items from
Hey guys I have an ajax jquery function that receives data from a php
I have a problem concerning Ajax and Jquery. I have a bunch of <li>

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.