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

  • Home
  • SEARCH
  • 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 7546077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:06:20+00:00 2026-05-30T09:06:20+00:00

I am writing a JQuery mobile application. In this application, I need to dynamically

  • 0

I am writing a JQuery mobile application. In this application, I need to dynamically build a list of sliders. Whenever I build my list though, only the traditional HTML-style dropdown list is rendered. I want the the JQuery mobile slider to be rendered. In an attempt to build this list dynamically, I’ve written the following:

  $.each(result.Results, function (i, r) {
    var s = "<li><div data-role='fieldcontain'><label for='person" + i + "'>" + r.FullName + "</label>";
    s += "<select name='person" + i + "' id='person" + i + "' data-role='slider'>";
    s += "<option value='false' selected='selected'>No</option><option value='true'>Yes</option>";
    s += "</select></div></li>";

    $("#personList").append(s);
  });
  $("#personList").listview("refresh");

  var sliders = $("#personList [data-role=slider]");
  for (var i = 0; i < sliders.length; i++) {
    sliders[i].slider();
  }

When the code is executed, I get a JavaScript error that says:

Uncaught TypeError: Object # has no method ‘slider’

If I don’t use the “sliders[i].slider();” code, the traditional HTML drop down list is still rendered instead of the JQuery Mobile slider. Can somebody please help identify what I’m doing wrong?

Thank you!

  • 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-30T09:06:21+00:00Added an answer on May 30, 2026 at 9:06 am

    I think you need to create a new JQuery object when using in a for loop like that…

      var sliders = $("#personList [data-role=slider]");
      for (var i = 0; i < sliders.length; i++) {
        $(sliders[i]).slider();
      }
    

    See this post for more info (more specifically the answer from SLaks)

    Of course you can get by without using the loop at all anyway…

    $("#personList [data-role=slider]").slider();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a mobile web application using JQuery Mobile, JQuery, Javascript. This is my
I am having a problem with an application I am writing in jquery mobile
I'm diving into writing a mobile app with jQuery Mobile/PhoneGap. I'm using this sample
I'm writing a jQuery Mobile application that requires user authentication. The same user cannot
I am writing jquery ajax code to call wcf service. In this case WCf
I need help writing Jquery to disable a group of radio button when one
I am writing my first cross-platform mobile application with the PhoneGap. In PhoneGap's site
I am currently writing a small web app using Asp.net MVC and jQuery mobile.
I'm writing jQuery for an app that's being build in JSF. The JSF components
I'm currently writing a mobile app (hopefully iOS or android) using the jquery mobile

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.