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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:51:40+00:00 2026-05-26T21:51:40+00:00

I’m working in Jquery Mobile and I’m having problems refreshing the listview after Ajax

  • 0

I’m working in Jquery Mobile and I’m having problems refreshing the listview after Ajax content has been pulled into a div.

Specifically, the Ajax content is being pulled into a listview which resides within a collapsible content block.

Here is my html:

<!DOCTYPE html> 
<html> 
<head> 
<meta charset="iso-8859-1">
<meta name="viewport" content="width=device-width, initial-scale=1"> 
<title>Edit Kits</title> 
<link rel="stylesheet" href="css/jquery.mobile-1.0rc2.css" />
<link rel="stylesheet" href="themes/Auer.css" />
<link rel="stylesheet" href="css/custom.css" />
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="js/custom.js"></script>
<script src="http://code.jquery.com/mobile/1.0rc2/jquery.mobile-1.0rc2.min.js"></script>
</head> 
<body> 
<div data-role="page" id="editkits" class="type-interior">
<div data-role="header">
<h1>Edit Kits</h1>
<a href="SPI_SearchLink" data-icon="home" class="ui-btn-left">Home</a>
<a data-rel="back" data-icon="back" class="ui-btn-right">Back</a>
<div class="header-sub">
<div class="ui-bar center-text"><img src="images/logo.png" id="logo" alt="spi_Cname"/></div>
</div>
<div data-role="navbar" class="navbar">
<ul>
<li><a href="SPI_TOCLink" data-theme="c">TOC</a></li>

<!-- SPI_HTML_ShowSearchMenu -->
<li><a href="SPI_SearchLink" data-theme="c">Search</a></li>
<!-- SPI_HTML_ShowSearchMenu -->

<!-- SPI_HTML_AllowKits -->
<li><a href="SPI_KitsLink" class="ui-btn-active" data-theme="c">Kits</a></li>
<!-- SPI_HTML_AllowKits -->

<!-- SPI_HTML_AllowSales -->
<li><a href="SPI_SalesLink" data-theme="c">SPI_SalesMenuText</a></li>
<!-- SPI_HTML_AllowSales -->

<!-- SPI_HTML_AllowOrderPlacement -->
<li><a href="SPI_ShopingCartLink" data-theme="c">Cart</a></li>
<!-- SPI_HTML_AllowOrderPlacement -->
</ul>
</div><!-- /navbar -->
</div><!-- /header -->

<div data-role="content">

<!-- SPI_No_Kit_Message -->
<div class="ui-grid-a">
<div class="ui-bar ui-bar-e center-text">
<br>
<h2>You have no saved Kits.</h2>
<p>To create a kit, add products to your shopping
cart and click "save as kit" on the menu at the bottom of your display.</p>
</div>
</div>
<!-- SPI_No_Kit_Message -->

<!-- SPI_HTML_HdrOnlyKit -->
<div data-role="collapsible" class="kit" id="SPI_KitId" data-collapsed="true" data-content-theme="d">
<h3>SPI_KitName SPI_KitNote</h3>
<div class="kitid"></div>
</div>
<!-- SPI_HTML_HdrOnlyKit -->

<!-- SPI_HTML_Kit -->
<h3><a href="WebCatPageServer.exe?AJAX&Action=Close_Kit&KitID=SPI_KitId">SPI_KitName SPI_KitNote</a></h3>
<form name="SPI_KitFormName" method="post" action="WebCatPageServer.exe">
<input name="Action" type="hidden" value="Not_Set" />
<input name="IsAjax" type="hidden" value="Yes" />
<input name="KitId" type="hidden" value="SPI_KitId" />
<input name="SearchTerm" type="hidden" value="Not_Set" />
<ul data-role="listview" id="list" data-inset="true" data-split-icon="delete" data-split-theme="d">
<!-- SPI_HTML_Kit_Product1 -->
<li><a href="javascript:document.ShoppingCart.Action.value='ItemLookup';document.ShoppingCart.SearchTerm.value='SPI_CartLookupPartNum';document.ShoppingCart.submit();">
<!-- SPI_KitProdItemNum -->
<h2>SPI_KitProdPartNum</h2>
<!-- SPI_KitProdItemNum -->
<p class="description">SPI_KitProdDesc</p>
<p><input type="text"  name="SPI_KitOrdQtyFieldName" onBlur="clickrecall(this,'0')" tabindex="SPI_KitOrdQtyTabIndex" value="SPI_KitProdQty"  onfocus="document.SPI_KitFormName.Action.value='Recalc_Kit';SPI_KitOrdQtyFieldName.select()"/></p>
<p>Unit Price: SPI_KitProdPrice</p>
<p>Ext. Price: <span class="price">SPI_KitProdExtPrice</span></p>
</a>
<a href="javascript:document.SPI_KitFormName.SPI_KitOrdQtyFieldName.value='DEL';document.SPI_KitFormName.Action.value='Recalc_Kit';document.SPI_KitFormName.submit();">Delete</a> 
</li>
<!-- SPI_HTML_Kit_Product1 -->
<!-- SPI_HTML_Kit_Product2 -->
<li><a href="javascript:document.ShoppingCart.Action.value='ItemLookup';document.ShoppingCart.SearchTerm.value='SPI_CartLookupPartNum';document.ShoppingCart.submit();">
<!-- SPI_KitProdItemNum -->
<h2>SPI_KitProdPartNum</h2>
<!-- SPI_KitProdItemNum -->
<p class="description">SPI_KitProdDesc</p>
<p><input type="text"  name="SPI_KitOrdQtyFieldName" onBlur="clickrecall(this,'0')" tabindex="SPI_KitOrdQtyTabIndex" value="SPI_KitProdQty"  onfocus="document.SPI_KitFormName.Action.value='Recalc_Kit';SPI_KitOrdQtyFieldName.select()"/></p>
<p>Unit Price: SPI_KitProdPrice</p>
<p>Ext. Price: <span class="price">SPI_KitProdExtPrice</span></p>
</a>
<a href="javascript:document.SPI_KitFormName.SPI_KitOrdQtyFieldName.value='DEL';document.SPI_KitFormName.Action.value='Recalc_Kit';document.SPI_KitFormName.submit();">Delete</a> 
</li>
<!-- SPI_HTML_Kit_Product2 -->
</ul>
</form>
<!-- SPI_HTML_Kit -->

</div><!-- /content -->

<div data-role="footer" id="footer" data-position="fixed">
<h4>&copy; Auer Steel 2011</h4>
</div><!-- /footer -->


</div><!-- /page -->
</body>
</html>

Here’s my ajax call:

$.ajaxSetup ({
cache: false
});
var ajax_load = "<img src='images/load.gif' alt='loading...' />";
$(".kit").click(function(){
var kitid = this.id;
var loadUrl = "http://68.188.40.182/WebCat/WebCatPageServer.exe?AJAX&Action=Open_Kit&KitID=" +kitid;
$(".kitid").html(ajax_load).load(loadUrl); 
});

I did try several variations of: $(“#list”).listview(“refresh”); to no avail.

I read somewhere that perhaps using loadUrl is the issue. Any ideas? Thanks!

UPDATE

Ok, using Avisek’s code as a starting point, I was able to come up with this. This works well, except it only refreshes the first listview within the first collapsible content box. Subsequent listviews in subsequent content boxes do not refresh. Any ideas? Thanks!

I used Avisek’s starting point and eventually got to this solution that seems to work:

UPDATE II
Ok, I seem to have solved this. I added the following code after the refresh code to in effect destroy the page after the ajax function was called on each collapsible element and subsequently each listview that was created:

jQuery('#editkits').page("destroy").page();

You can see the complete code below:

 $(".kit").click(function(){
    $(".kitid").empty().html('<img src="images/load.gif" />');
    var kitid = this.id;
    var url = 'http://68.188.40.182/WebCat/WebCatPageServer.exe?AJAX&Action=Open_Kit&KitID=' +kitid;
    $.ajax({
         url : url,
         dataType: "html",
         cache: false,
         success : ajaxCallDone,
         complete: function() {
          },
          error : function(XMLHttpRequest, textStatus, errorThrown) {
          alert("Error type :" + errorThrown+ " Error message :" + XMLHttpRequest.responseXML+ " textStatus: "+textStatus);
          }
        });
    function ajaxCallDone(data)
    {
      $(".kitid").html(data);
      try {
        $('#list').listview('refresh');
    } catch(e) {
         $('#list').listview();
    }
  jQuery('#editkits').page("destroy").page();
    }
     });
  • 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-26T21:51:40+00:00Added an answer on May 26, 2026 at 9:51 pm

    Instead of jquery load; try ajax

    and on success- populate html & on complete- do a refresh

    for e.g-

    var url = 'your_url';
    var dataString = "Action=Open_Kit&KitID=" +kitid;
    
    $.ajax({
            url : url,
            data: dataString,
            success : ajaxCallDone,
            complete: function() {
                     $("#list").listview("refresh");
            }
            error : function(XMLHttpRequest, textStatus, errorThrown) {
                alert("Error type :" + errorThrown+ " Error message :" + XMLHttpRequest.responseXML+ " textStatus: "+textStatus);
            }
        });
    
    
    
    function ajaxCallDone(data)
    {
      //populate the html
      $(".kitid").html(data);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into

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.