Jon Phipps's personal annotations on this page
Jonphipps bookmarked
on 2007-10-15
-
jQuery can be used for XML processing on the Web as well as HTML processing, and in this article I show some examples of this use.
This link has been bookmarked by 5 people . It was first bookmarked on 15 Oct 2007, by Jon Phipps.
-
-
$(function() {
$('#update-target a').click(function() {
$.ajax({
type: "GET",
url: "labels.xml",
dataType: "xml",
success: function(xml) {
$(xml).find('label').each(function(){
var id_text = $(this).attr('id')
var name_text = $(this).find('name').text()
$('<li></li>')
.html(name_text + ' (' + id_text + ')')
.appendTo('#update-target ol');
}); //close each(
}
}); //close $.ajax(
}); //close click(
}); //close $(
</script>
</head>
<body>
<p>
<div id='update-target'>
<a href="http://www.xml.com/#">Click here to load addresses</a>
<ol></ol>
</div>
</p>
</body>
</html>
-
-
-
jQuery can be used for XML processing on the Web as well as HTML processing, and in this article I show some examples of this use.
-
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.