Question by Anthony a: Help with html code please!?
So far this html code loads up a music player with 4 panes. The first pane loads an XML file with the artist and the title of the album concatenated.
I need to know how get the tracks of the artist to appear on the second iframe and the song to be on the third iframe and ready to play.
Please help..if you need to know anything about the xml file please ask because i can’t fit the content of it on here. But the tags the xml file has are “albums”, “album”, “title”, “artist”, “artwork” and “track”
Please see if you can help!
Thanks
title>Mi Tunes
function XMLload(){ jQuery.post(url,function(data){getxml(data);},'xml'); }
function dataFromTag(node,t){ var d=node.getElementsByTagName(t); if(d.length==0) return(''); return(d[0].firstChild.nodeValue); }
jQuery(document).ready(function(){XMLload();});
// all the code above this line can be re-used without change // all the code below will need altering for a different document and different structure
var url='music.xml'; var xmlalbums; function getxml(xmldoc){ xmlalbums = xmldoc.getElementsByTagName('album');
var hstr = '
Albums
';
with( document.getElementById('pane1').contentDocument ) { open(); write(hstr); close(); }
}
frameborder="yes"
scrolling="yes" font-size="large">
scrolling="yes">
scrolling="yes">
Best answer:
Answer by Sam D.
My advice would be to use jQuery media plugin.
You can set it to load the contents of the iframe panes dynamically by just calling the plugin in the load event.
http://www.jquery4u.com/media/8-jquery-media-plugins/
Hope this helps.
Add your own answer in the comments!