Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to Show Listview Conent in New Page Jquery
    text
    copied!<p>I have XML Service, Which i have Parsed and Got Response From Service. Next I have took the Response and Added to Listview from Jquery Mobile.I have Successfully Populated List View with Some Details and one Sample Image in it. My Problem is When i have Clicked on list Item i have to show data regarding to the list item. Say I have Clicked the Second List Item then Second List Item Should be Shown in New Page.What i have Tried is.</p> <pre><code> $(document).ready(function() { $.ajax({ type: "GET", url: "http://api.geonames.org/children?geonameId=3175395&amp;username=tutorialsgeek", dataType: "xml", success: xmlParser, error: function(errorThrown) { alert("An error occurred!" + errorThrown); } }); }); function xmlParser(data) { xml = data; var imageLink = "https://hca.twimg.com/a/1380571156/gazebo/img/bg-hero.jpg"; $('#load').fadeOut(); $(xml).find('geonames geoname').each(function(index, val) { var output = ""; var locationName = $(this).find("toponymName").text(); var name = $(this).find("name").text(); output += '&lt;li&gt;'; output += '&lt;a href="#blogpost"&gt;'; output += '&lt;h3&gt;'; output += locationName; output += '&lt;/h3&gt;'; output += '&lt;img src="' + imageLink + '" alt="image" /&gt;'; output += '&lt;p&gt;'; output += 'name :' + name; output += '&lt;/p&gt;&lt;/a&gt;'; output += '&lt;/li&gt;'; $("#list").append(output); $('#list').listview('refresh'); }); } </code></pre> <p>and my html page is..</p> <pre><code>&lt;div data-role="page" id="listPage"&gt; &lt;div data-role="header"&gt; &lt;h1&gt;XMl Parsing&lt;/h1&gt; &lt;/div&gt;&lt;!--End of header--&gt; &lt;div data-role="content"&gt; &lt;div id="result"&gt; &lt;ul data-filter="true" data-role="listview" data-theme="c" id= "list"&gt; &lt;li id="load"&gt;Loading Data...&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt;&lt;!--end of content--&gt; &lt;/div&gt; &lt;div data-role="page" id="blogpost"&gt; &lt;div data-role="header"&gt; &lt;h1&gt;XMl Parsing&lt;/h1&gt; &lt;/div&gt;&lt;!--End of header--&gt; &lt;div data-role="content"&gt; &lt;div id="result"&gt;&lt;/div&gt; &lt;/div&gt;&lt;!--end of content--&gt; &lt;/div&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload