如果我去this Google Maps page,某些HTML缺少查看源文件,但在Firebug中顯示。GM_xmlhttpRequest的responsetext缺少一些HTML
同樣,當同一個URL被傳遞給我的函數時,下面的HTML不會顯示在responseText
中,但是當我打開頁面時它會在Firebug中顯示。
<a id="mapmaker-link" class="kd-button mini left" style="" href="https://www.google.com/mapmaker?ll=41.06877,-112.047203&spn=0.038696,0.132093&t=h&z=14&vpsrc=0&q=1093+W+3090+S,Syracuse,+UT&utm_medium=website&utm_campaign=relatedproducts_maps&utm_source=mapseditbutton_normal">
這裏是我使用的功能:
function updateMap(url) {
GM_xmlhttpRequest(
{
method: 'GET',
url: url,
onload: function(resp) {
var ll = resp.responseText.split("mapmaker?")[1];
ll = ll.split("&")[0];
document.getElementById('googlemap').href = url+"&"+ll;
}
});
}
我已經放置在pastebin.com/Tt8nrzG8樣品responseText
值。
你可以發佈'resp.responseText'的內容嗎? – plalx 2013-04-09 22:46:24
https://maps.google.com/?q=1093+W+3090+S,Syracuse,+UT – 2013-04-10 00:57:37