Javascript 变量中加载的网页内容存储
我正在尝试将网页内容加载到div:-Javascript 变量中加载的网页内容存储,javascript,xml,variables,Javascript,Xml,Variables,我正在尝试将网页内容加载到div:- <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascript" src="http://j.maxmind.com/app/geoip.js" ></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="http://j.maxmind.com/app/geoip.js" ></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script>
function load(){
var location = "http://services.gisgraphy.com/geoloc/search?lat=43.00034713745117&lng=-75.4999008178711&radius=7000";
$("#siteloader").html('<object data="'+location+'">');
}
</script>
<body onload="load()">
<div id="siteloader"></div>
</body>
</head>
</html>
函数加载(){
变量位置=”http://services.gisgraphy.com/geoloc/search?lat=43.00034713745117&lng=-75.4999008178711&半径=7000”;
$(“#siteloader”).html(“”);
}
完成了将网页内容加载到div中的代码后,现在我想将此内容存储到一个
变量中
任何可能的想法….由于同源性问题而不可能。将其加载到服务器上并在那里进行处理。但是既然它是一个web服务,为什么不使用该服务加载数据呢?像这样的地理编码/地理编码?地址=108%20avenue%20des%20champs%20elysees%20paris&countrycode=FR&outputformat=json@mplungjan不,不是这种类型,我想要显示在div标记中的内容