如果我去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