[英]jquery element from another page with $.get
我正在嘗試從另一個具有id = usertags的頁面中提取元素。 我正在使用.get方法。
由於某種原因,我無法實現它,沒有錯誤。
$.get('/cgi-bin/koha/opac-tags.pl', function(data) {
var tags = $(data).find("#usertags");
$("#mainuserblock").append(tags);
console.log( $(data) );
});
我對日志信息$(data)所說的感到困惑。 在我看來,它實際上並不是從opac-tags.pl頁面中拉出的,而是從其他地方拉出來的:
{
"length": 0,
"prevObject": {
"0": {
"auth": {
"0": {
"0": {},
"1": {},
"2": {},
"3": {},
"4": {}
},
"1": {
"0": {},
"1": {},
"2": {},
"3": {},
"4": {},
"5": {}
}
},
"searchform": {
"0": {
"0": {},
"1": {},
"2": {},
"3": {},
"4": {},
"5": {},
"6": {}
},
"1": {},
"2": {}
},
"location": {
"href": "http://viu.bywatersolutions.com/cgi-bin/koha/opac-main.pl",
"origin": "http://viu.bywatersolutions.com",
"protocol": "http:",
"host": "viu.bywatersolutions.com",
"hostname": "viu.bywatersolutions.com",
"port": "",
"pathname": "/cgi-bin/koha/opac-main.pl",
"search": "",
"hash": ""
}
},
"context": {
"auth": {
"0": {
"0": {},
"1": {},
"2": {},
"3": {},
"4": {}
},
"1": {
"0": {},
"1": {},
"2": {},
"3": {},
"4": {},
"5": {}
}
},
"searchform": {
"0": {
"0": {},
"1": {},
"2": {},
"3": {},
"4": {},
"5": {},
"6": {}
},
"1": {},
"2": {}
},
"location": {
"href": "http://viu.bywatersolutions.com/cgi-bin/koha/opac-main.pl",
"origin": "http://viu.bywatersolutions.com",
"protocol": "http:",
"host": "viu.bywatersolutions.com",
"hostname": "viu.bywatersolutions.com",
"port": "",
"pathname": "/cgi-bin/koha/opac-main.pl",
"search": "",
"hash": ""
}
},
"length": 1
},
"context": {
"auth": {
"0": {
"0": {},
"1": {},
"2": {},
"3": {},
"4": {}
},
"1": {
"0": {},
"1": {},
"2": {},
"3": {},
"4": {},
"5": {}
}
},
"searchform": {
"0": {
"0": {},
"1": {},
"2": {},
"3": {},
"4": {},
"5": {},
"6": {}
},
"1": {},
"2": {}
},
"location": {
"href": "http://viu.bywatersolutions.com/cgi-bin/koha/opac-main.pl",
"origin": "http://viu.bywatersolutions.com",
"protocol": "http:",
"host": "viu.bywatersolutions.com",
"hostname": "viu.bywatersolutions.com",
"port": "",
"pathname": "/cgi-bin/koha/opac-main.pl",
"search": "",
"hash": ""
}
},
"selector": "response = {\n\tadded: 0,\n\tdeleted: 0,\n\terrors: 0\n\n\n};"
}
有沒有人經歷過這樣的事情?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.