如何将此ajax响应转换为jquery对象 [英] How do I convert this ajax response to a jquery object

查看:77
本文介绍了如何将此ajax响应转换为jquery对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取页面的内容并像操作任何jquery对象一样操作它,但我无法这样做。我已经尝试使用 parseHTML 并将其简单地抛入jquery函数,如此 $($。trim(res))。jqueryMethod();在这两种情况下,我得到一个jquery对象数组,它们不运行任何jquery方法。他们都处于休眠状态。



我尝试过的事情:



当前代码如下

I'm trying to get the contents of a page and manipulate it just as I would with any jquery object but I'm unable to do so. I've tried using parseHTML and simply throwing it into the jquery function like so $($.trim(res)).jqueryMethod(); in both cases, I get an array of jquery objects which do not run any jquery methods whatsoever. They're all dormant.

What I have tried:

The current code is as follows

$.get('https://www.bonhams.com/auctions/24308/?category=results').done(function(page) {
console.log($($.trim(page)))
	})



我怎么去获取一个jquery对象,例如我可以`find()`谢谢。


How do I go about getting a jquery object from which I can `find()` for instance? Thanks.

推荐答案


.trim(res))。jqueryMethod();在这两种情况下,我得到一个jquery对象数组,它们不运行任何jquery方法。他们都处于休眠状态。



我尝试过的事情:



当前代码如下

.trim(res)).jqueryMethod(); in both cases, I get an array of jquery objects which do not run any jquery methods whatsoever. They're all dormant.

What I have tried:

The current code is as follows


.get('' https://www.bonhams.com/auctions/24308/?category=results')。done( function (页){
console .log(
.get('https://www.bonhams.com/auctions/24308/?category=results').done(function(page) { console.log(


这篇关于如何将此ajax响应转换为jquery对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆