Chill, do you have a live version we can look at? Also, getShow(this); the "this" is referring to the link and not what you think. Not exactly sure what "this" is supposed to refer to, but you should do it like getShow('+this+');"
On 5/14/07, chillstroll <[EMAIL PROTECTED]> wrote: > > > Greeting all, > I'm sure this is quite simple; however not sure how do it. I want to > be able to get a specific xml node from the xml document using a > function call after I have initially retrieved it with jquery. Hope my > code will explain better: > > XML DOC: > <?xml version="1.0" encoding="ISO-8859-1"?> > <schedule> > <show> > <date>Monday, May 14, 2007</date> > <dayofweek>Monday</dayofweek> > <image>051407.jpg</image> > <title>San Antonio Hosts Training for Ministry > Conference</title> > <description>Text Here</description> > <filename>2007-5-14.asx</filename> > <guests/> > <specialoffer>Names of God bracelet</specialoffer> > <specialofferproductid>431</specialofferproductid> > </show> > <show> > <date>Tuesday, May 15, 2007</date> > <dayofweek>Tuesday</dayofweek> > <image>051507.jpg</image> > <title>Training for Ministry Conference Impacts the Alamo > City</ > title> > <description>More Text Here</description> > <filename>2007-5-15.asx</filename> > <guests/> > <specialoffer>Names of God bracelet</specialoffer> > <specialofferproductid>431</specialofferproductid> > </show> > </schedule> > > JQUERY CODE: > <script type="text/javascript"> > $(function() { > $.ajax({url: 'tiydschedule.xml', > type: 'GET', > dataType: 'xml', > timeout: 1000, > error: function(){ > alert('Error loading XML document'); > }, > success: function(xml){ > $('show',xml).each(function(id){ > var dayofweek = > $(this).find('dayofweek').text(); > var image = $(this).find('image').text(); > var divrow = '<div><h4>'+dayofweek+'</h4><p><a > href="#" > onclick="getShow(this);"><img src="/images/weekly_guide/'+image+'" > class="today" width="105" height="75"/></a></p></div>'; > $('.wkguidedays').append(divrow); > }); > } > }); > }); > function getShow(xmlnode) { > // do something with xmlnode > var date = $(xmlnode).find('date').text(); > var dayofweek = $(xmlnode).find('dayofweek').text(); > var image = $(xmlnode).find('image').text(); > var title = $(xmlnode).find('title').text(); > var description = $(xmlnode).find('description').text(); > var filename = $(xmlnode).find('filename').text(); > var guests = $(xmlnode).find('guests').text(); > var specialoffer = $(xmlnode).find('specialoffer').text(); > var specialofferproductid = $ > (xmlnode).find('specialofferproductid').text(); > alert(title); > } > </script> > > The first part works fine; however the call to the getShow(xmlnode) > function which I want to receive the passed xml node does not work. > I'm appending <a href="#" onclick="getShow(this);"> to the divrow > variable as I initially loop thru the xmlnodes. Nothing shows up on > the alert. > > Is there a simpler way to do this? I am on the right track? Thanks for > the help. > > -- Benjamin Sterling http://www.KenzoMedia.com http://www.KenzoHosting.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery (English)" group. To post to this group, send email to jquery-en@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/jquery-en?hl=en -~----------~----~----~----~------~----~------~--~---