Hi Blair

 

Thanks for your suggestion. Seems to work perfectly in Firefox but not in IE6.

 

I think it takes objection to this line:

 

var $this=$(this);

 

and says ‘error: object required’

 

Any ideas on how to fix it?

 

Thanks

 

Richard

 


From: Blair McKenzie [mailto:[EMAIL PROTECTED]
Sent: 02 November 2006 22:55
To: [EMAIL PROTECTED]; jQuery Discussion.
Subject: Re: [jQuery] Parsing XML

 

I would suggest this:

var reminders = [];
$('reminder',xml).each(function(i) { // apply this function to each reminder (index as parameter)

var $this=$(this); // each applies the function so that 'this' is the relevant element

reminders[i] = {

id:$this.find("id").text(),
date:$this.end().find("date").text(), // end() because the previous find("id") is persistent
event:$this.end().find("event").text(),
start:$this.end().find("start").text(),
end:$this.end().find("end").text(),

};

});

Blair


--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.13.28/518 - Release Date: 04/11/2006

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to