Loading...
Copy code
Close
Permalink
Close
Please tell us why you want to mark the subject as inappropriate.
(Maximum 200 characters)
Report Inappropriate
Cancel
Private Message
From :
guest
To :
Subject :
Content :
Type the characters you see in the picture below.
Send
Cancel
From :
guest
To :
Subject :
Content :
Type the characters you see in the picture below.
Send
Update
Cancel
Feedback
Email ID
Subject :
Comments :
Send
Cancel
Private Message
Type the characters you see in the picture below.
Type the characters you see in the picture below.
Attach files
Desktop
Google Docs
Each Attachment size should not exceed 1.0 MB.
Max no of attachments : 3
Loading User Profile...
guest
Response title
This is preview!
Attachments
Publish
Back to edit
Cancel
(
)
Sign In
New to this Portal? Click here to
Sign up
You can also use the below options to login
Login with Facebook
Login with Google
Login with Yahoo
jQuery
Plugins
UI
Meetups
Forum
Blog
About
Donate
All Forums
Recent Posts
Log In
Search
jQuery
Search
jQuery Forum
Move this topic
Forum :
Getting Started
Using jQuery
Using jQuery Plugins
Using jQuery UI
Developing jQuery Core
Developing jQuery Plugins
Developing jQuery UI
QUnit and Testing
About the jQuery Forum
jQuery Conferences
jQuery Mobile
Developing jQuery Mobile
Sub forum :
Move this topic
Cancel
jQuery Mobile
MejdoubSa..
Parse XML via jquery on listview jquerymobile
in
jQuery Mobile
•
8 years ago
hello i want load xml data into listview onmy jquery mobile using ajax but don't work
here is html
<div data-role="page" id="VHC">
<header data-role="header" id="head_home">
<div class="top_head_home"></div><br />
<div class="fot_head_home"></div>
</header>
<div data-role="navbar">
<ul>
<li><a href="#home" data-icon="back">Retour</a></li>
<li><a href="#home" data-icon="home">Accueil</a></li>
<li><a href="#rch" data-icon="search">Recherche</a></li>
</ul>
</div>
<section data-role="content" id="cont_home">
<a href="#"><div class="list"></div></a>
</section>
<footer data-role="footer" id="foot_Auth">
<div class="top_footer_auth"></div>
<div class="fot_footer_auth">TEST COPYRIGHT<sup>©</sup>2015</div>
</footer>
</div>
here is js script
$(document).ready(function()
{
$.ajax({
type: "GET",
url: "vehicules.xml",
dataType: "xml",
success: parseXml
});
});
function parseXml(xml)
{
$("#list").html("<ul id='content' data-role='listview' data-inset='true'></ul>");
$(xml).find("vehicule").each(function()
{
$("#content").append("<li><a href='"+$(this).find("codeid").text()+"'><h2>"+$(this).find("driver").text()+"</h2><p>"+$(this).find("type").text()+"</p></a></li>");
});
}
here is the xml code
<?xml version="1.0" encoding="utf-8"?>
<vehicules>
<vehicule>
<codeid >87521</codeid>
<driver>Salim</driver>
<type>Subaru Impreza WRX STI 2015</type>
<speed>60km/h</speed>
</vehicule>
<vehicule>
<codeid >892317</codeid>
<driver>Bilel</driver>
<type>BWM X6</type>
<speed>160km/h</speed>
</vehicule>
<vehicule>
<codeid >25741</codeid>
<driver>Noor</driver>
<type>Citroen C3</type>
<speed>60km/h</speed>
</vehicule>
</BookList>
1
Replies(2)
oj90
Re: Parse XML via jquery on listview jquerymobile
8 years ago
You are using
$("#list") when you have specified class="list". Not sure if that will fix everything but it certainly won't work with an incorrect selector.
MejdoubSa..
Re: Re: Parse XML via jquery on listview jquerymobile
8 years ago
thanks i solved it
Leave a comment on oj90's reply
Change topic type
Topic Type :
Discussions
Questions
Ideas
Problems
No of days :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Change topic type
Cancel
Link this topic
Provide the permalink of a topic that is related to this topic
Permalink
Save
Close
Reply to MejdoubSalim's question
Top
Reply
{"z50321862":[14737000006158226,14737000006158267],"z37102934":[14737000006154989]}
Statistics
2
Replies
2070
Views
0
Followers
Tags
No tags available for this topic.
Cancel
Actions
Permalink