开发者

jquery - ajaxForm plugin and only using part of the response

I know with jquery and ajax, you can specify what for example, an id of the element to get back (so you don't have to parse the whole document yourself).

I'm wondering where to do this in the ajaxForm plugin, or if I have to do that myself.

For the simplest example I can think of, here's this:

$(#myForm).ajaxForm({
    success: function(responseText){
        alert(responseText);
    }
});

What if rather than alerting the whole result (which is an entire page), I'd like to alert only what's in a certain element of the result (say, <div id="result"></di开发者_StackOverflow社区v>)

Best way to accomplish this?


alert($(responseText).find('#result'));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜