Created
July 10, 2012 08:59
-
-
Save padde/3082143 to your computer and use it in GitHub Desktop.
SO question #11409692
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<item name="a"> | |
<item name="d"> | |
<item name="g"></item> | |
</item> | |
<item name="e"></item> | |
<item name="f"></item> | |
</item> | |
<item name="b"></item> | |
<item name="c"></item> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>SO Question #11409692</title> | |
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(function(){ | |
$('button').on('click', function(){ | |
alert('parse'); | |
$.ajax({ | |
type: "GET", | |
url: "http://jsbin.com/imakap", | |
dataType: "xml", | |
success: function(xml) { | |
$(xml).filter('item').each(function(){ | |
var name = $(this).find('name').text(); | |
alert(name); | |
}); | |
}, | |
error: function(err) { | |
alert('error'); | |
} | |
}); | |
}); | |
}); | |
</script> | |
</head> | |
<body> | |
<button>Run</button> | |
<div id="result"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment