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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:08:24+00:00 2026-06-14T06:08:24+00:00

I am building a mobile interface for a search engine. The main CGI script

  • 0

I am building a mobile interface for a search engine. The main CGI script returns a list of results as a <ul>. I then have a JQM script that iterates through each list item and makes an Ajax request to another CGI script to gather more information and insert it as a nested <ul>. The mechanics work, I’m just having problems with the display not looking as I’d expect.

First I’ll show you my code, then what I’d expect to see, finally what I’m actually seeing.

Here is a truncated version of the HTML that the main CGI script produces (from Firebug, so after jQuery has had it’s wicked way with it), in reality there are a number of list elements, but I’m just showing one as an illustration:

<ul id="searchresults" data-role="listview" class="ui-listview">
    <li id="64076268" class="result_item ui-li ui-li-static ui-btn-up-b ui-li-has-count">
        <a href="#indexPage&amp;ui-page=searchresults-0">
            <h1 class="ui-li-heading">Programming Perl / Tom Christiansen, Brian D. Foy &amp; Larry Wall.</h1>
            <p class="creator ui-li-desc">Tom Christiansen brian d foy; Larry Wall; Larry Wall</p>
            <p class="ui-li-desc">c2012</p>
            <span class="ui-li-count ui-btn-up-c ui-btn-corner-all">2 versions</span>
        </a>
    </li>
</ul>

The <a> element is being generated by jQuery, I don’t understand why. What I am expecting is this:

<ul id="searchresults" data-role="listview" class="ui-listview">
    <li id="64076268" class="result_item ui-li ui-li-static ui-btn-up-b ui-li-has-count">
        <h1 class="ui-li-heading">Programming Perl / Tom Christiansen, Brian D. Foy &amp; Larry Wall.</h1>
        <p class="creator ui-li-desc">Tom Christiansen brian d foy; Larry Wall; Larry Wall</p>
        <p class="ui-li-desc">c2012</p>
        <span class="ui-li-count ui-btn-up-c ui-btn-corner-all">2 versions</span>
        <ul class="frbr">
            <li>
                <h1>Programming Perl</h1>
            </li>
            <li>
                <h1>Programming Perl / Tom Christiansen, Brian D. Foy &amp; Larry Wall.</h1>
            </li>
        </ul>
    </li>
</ul>

Which should cause the nested <ul>, as I understand it, to render as a separate page that will be displayed when the user clicks the parent <li>. That’s certainly how the jQuery docs on listviews describes it.

Here’s the jQuery that is grabbing the nested list and appending it to the parent <li>:

$(document).ready(function(){

    $(".result_item").each(function() {

        var me = $(this);

        $.ajax({
            type: "GET",
            url: "/m/ajax/get_frbrgroup_details.cgi",
            data: { frbrgroup: me.attr("id") },
            datatype: "text",
            cache: false,
            success: function(reply) {
                me.append(reply);
            },
            complete: function() {
                $("#searchresults").listview("refresh");
            }

        })
    });
});

And finally a screenshot of what I’d expect to see and what I am actually seeing:

Expected

What I am actually seeing

Is anyone able to shed any light on this as, from all the research I’ve done, I think I’m doing everything right! Thanks 🙂

  • 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-06-14T06:08:26+00:00Added an answer on June 14, 2026 at 6:08 am

    Finally figured this one out. I was missing the fact that when JQM processes the page when it’s initially rendered, it moves the nested <ul> out of its parent <li>, so my attempt to target it there with the append was failing, as was my listview(“refresh”) on the parent <ul>. So I now give the nested <ul> a unique id so, once JQM has moved it out of the parent <li> I can still target it with the append and refresh. Seems to work! 🙂

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

Sidebar

Related Questions

I am building a mobile service that require a lot of search queries. The
I am building a mobile website that uses the main jquery library and some
I am building mobile web sites with Jquery Mobile. I also have a javascript-based
I am building a mobile webapp with jquery mobile. Now what I have. I
I'm building a mobile interface with JQuery Mobile for an already existing web app
I am building a mobile site that works like a slideshow. There are a
I'm building a mobile web application that may or may not rely on ajax,
I'm building a mobile phone application and have created many mockups in Photoshop CS4.
I am building an mobile flex app in eclipse indigo and have my app
We are building a mobile application that needs to work on both Android and

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.