I'm trying to parse a String which is XML like, and looks like this:
<note>
<user>Username 1</user>
<notes>Notes user wrote</notes>
</note>
<note>
<user>Username 2</user>
<notes>Notes user wrote</notes>
</note>
I'm a little bit confused with how to use the JQuery XML parser, I guess i'm used to SQL programming to access data.
What I want to do is print out the note based on the user name
so in SQL that'd be "SELECT notes FROM note WHERE user='Username 1'"
How do you do a selection like that in the JQuery XML Parser?
Edit what i'm trying:
For some reason this keeps returning Null:
var xml = '<url>urlofpage1</url><notes>These notes should load!</notes>';
var $xml = $(xml);
var $notes = $xml.find('url')
.filter(function() { return $(this).text() == 'urlofpage1' })
.closest('notes');
console.log('$notes: ', $notes.html());