[jQuery] selectors in $.post return with HTML context
I'm having trouble using a subsequent selector on an HTML page
returned from $.post, while trying to write a Ubiquity command.
If I log or display ajdata, as returned from the $.post, it contains
the HTML page, as expected, and shows up as a jQuery object in
Firebug.
What I want to do is use a jQuery selector to extract a named textarea
within the returned HTML, so I plug in the object as the context and
provide a selector, as below:
jQuery.post(updateUrl, updateParams, function(ajdata) {
CmdUtils.log(jQuery("textarea[name=cloudsource]", ajdata).val()) },
"html");
Firebug just gives me "unknown" for the response. If I remove the
slector, and just pass "ajdata" to CmdUtils.log, then I see a jQuery
object in Firebug.
At first I thought my selector was in error, but even changing it to
obvious things like "body", "div", etc produced the same "undefined"
in Firebug, so I guess I'm misunderstanding how context works for
jQuery. Any insight would be appreciated.