此回复为自动发出,仅用于显示而已,并无任何其他特殊作用
楼主【victorn】截止到2008-07-07 19:16:36的历史汇总数据(不包括此帖):
发帖的总数量:2 发帖的总分数:40
结贴的总数量:2 结贴的总分数:40
无满意结贴数:0 无满意结贴分:0
未结的帖子数:0 未结的总分数:0
结贴的百分比:100.00% 结分的百分比:100.00%
无满意结贴率:0.00 % 无满意结分率:0.00 %
敬礼!
楼主【victorn】截止到2008-07-07 19:16:36的历史汇总数据(不包括此帖):
发帖的总数量:2 发帖的总分数:40
结贴的总数量:2 结贴的总分数:40
无满意结贴数:0 无满意结贴分:0
未结的帖子数:0 未结的总分数:0
结贴的百分比:100.00% 结分的百分比:100.00%
无满意结贴率:0.00 % 无满意结分率:0.00 %
敬礼!
<body>
<input type="button" onclick="dl()" value="确定">
<iframe id="haha" name="haha" src="xx.html"></iframe>
<script>
$f=function(p){return document.frames?document.frames[p]:$(p).contentWindow;}
function dl()
{
alert($f("haha").document.body.innerHTML);
}
</script>
</body>
</html>
而FF中马上就报错。
就是说,不能用到jsp、php、asp等语言,只能用到js与html,能实现跨域吗?
呵呵,这样不行的。
这样跨域是不允许的,试试吧:iframe的src="http://esoft.bokee.com/5469097.html",点按钮时会有“拒绝访问”的错误。
iframe只能显示这个link的内容,在本地不能获取这个页面的相关内容,与之交互。
这就是跨域问题。
即在domain1.com站点中使用动态网页(ASP,PHP,JSP等)作为代理页面读取domain2.com站点中的资源, 然后在domain1.com站点中使用AJAX读取本域下的代理页面。
或者用Dom遍历con.html整个Document的所有节点。
只通过js+html是不可以的
ASP.NET 读取的方法
//--需要引用 using System.Net 以及 using System.IO;
private string GetContentFromUrll(string _requestUrl)
{
string _StrResponse ="";
HttpWebRequest _WebRequest = ( HttpWebRequest )WebRequest.Create( _requestUrl );
_WebRequest.Method = "GET";
WebResponse _WebResponse = _WebRequest.GetResponse();
StreamReader _ResponseStream = new StreamReader( _WebResponse.GetResponseStream(), System.Text.Encoding.GetEncoding("gb2312"));
_StrResponse = _ResponseStream.ReadToEnd();
_WebResponse.Close();
_ResponseStream.Close();
return _StrResponse;
}