Hello,
I'm using a jQuery plugin named "jParse" to parse an XML file like so:
$('#content').jParse({
ajaxOpts: {url: 'data.xml'},
elementTag: ['title', 'description'],
output: '<h2>jpet0</h2><p>jpet1</p>'
});
As you can see, the "jpet" variables correlate with the elementTag array.
How would I check to see if the jpet var contains data (as some of the tags in the XML are empty) and withhold the HTML tags if it doesn't?
This doesn't work:
$('#content').jParse({
ajaxOpts: {url: 'data.xml'},
elementTag: ['title', 'description', 'extra'],
output: if (jpet0) { '<h2>jpet0</h2>' } + '<p>jpet1</p><p>jpet2</p>'
});
But it does give a good idea of what I'm trying to achieve.
Thanks in advance!