Iframe的src="http://www.web.com",这个时候取www.web.com里面控件值???

lmh79 2003-02-17 02:47:37
能取到吗?

<iframe name="temp" src="test.htm">
<iframe>
这个时候取test.htm里控件的值没有问题,可是如下:
<iframe name="temp" src="http://www.web.com">
<iframe>
我想取里面的某个控件值的时候老是报对象错误?

那位高人给个解释!!!
...全文
661 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
netdust 2003-03-06
  • 打赏
  • 举报
回复
1、中文有乱码
2、图片路径都不对了

-------
图片路径的问题可以自己解决,但中文乱码不会
另外有没有简单的方法
ssm1226 2003-02-17
  • 打赏
  • 举报
回复
中文乱码问题,可以参考:

http://expert.csdn.net/Expert/FAQ/FAQ_Index.asp?id=1842
lmh79 2003-02-17
  • 打赏
  • 举报
回复
不过在4.htm的<iframe name=frm src="4.asp"></iframe>里面看到的是乱码!
lmh79 2003-02-17
  • 打赏
  • 举报
回复
间接方式来取,嗯,这样应该可以!
ssm1226 2003-02-17
  • 打赏
  • 举报
回复
use xmlhttp:
4.htm
<html>
<head>

</head>
<body >
<iframe name=frm src="4.asp"></iframe>

<INPUT type="button" value="Button" id=button1 name=button1 onclick="test()">
<SCRIPT LANGUAGE=javascript>
<!--
function test(){
alert(frm.document.all.name.value)
}
//-->
</SCRIPT>
</body>
</html>
4.asp
<%
dim xmlhttp
set xmlhttp=server.CreateObject("Microsoft.XMLHTTP")
xmlhttp.open "get","http://www.csdn.net",false
xmlhttp.send

Response.Write xmlhttp.responseText
%>



lmh79 2003-02-17
  • 打赏
  • 举报
回复
没有完全弄懂,那到底可以得到吗?
wsj 2003-02-17
  • 打赏
  • 举报
回复
安全策略不允许

除非得到许可



http://www.web.com
---------------
document.domain = "yourdomain.com"
...


http://www.yourdomain.com
-----------------------------
<iframe name="mydomainpage" src="test.htm">
<iframe>
<iframe name="otherdomain" src="http://www.web.com">
<iframe>


test.htm
--------------
parent.otherdomain.document.body.....
xuzuning 2003-02-17
  • 打赏
  • 举报
回复
跨域就不幸了

87,921

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧