Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

jplindstrom (594)

  (email not shown publicly)

Journal of jplindstrom (594)

Tuesday May 20, 2008
08:16 AM

jQuery to the rescue (again)

[ #36474 ]

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");


The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.