If you do any kind of client side web programming, you should check out jQuery. Its pragmatic design is just awesome.
Today I had this Ajax response that I needed to parse to fetch an id so I could have the browser redirect to the correct URL.
Hmmm... how to work the xml? XPath? Fiddling with the DOM? I do that so rarely I can never remember the methods to call.
If only I could use the same simple jQuery approach!
Well, duh, it turns out I can.
var xml = $.ajax({ async: false, ... }).responseXML; var import_id = $(xml).find("import").attr("iid");