首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

JS跨域的有关问题!高分!分不够再加!

2012-03-22 
JS跨域的问题!!!高分求助!!!分不够再加!!!http://a2.net.com/main.htm:iframe nameabc srchttp://a1.n

JS跨域的问题!!!高分求助!!!分不够再加!!!
http://a2.net.com/main.htm:  
  <iframe name=abc src="http://a1.net.com/ttt.htm"></iframe>
  <input type="text" name="bbb" value="0" />  
 
   
http://a1.net.com/ttt.htm: 
  <input type=button value=ok onclick="aaa();">
  <SCRIPT LANGUAGE="JavaScript">  
  var i=0;
  function aaa()  
  { 
  parent.document.getElementById("abc").height=i*30;
  parent.document.getElementById("bbb").value=i;
  i++;
  }
  </SCRIPT>

[解决办法]

怎么了?
[解决办法]
http://heimuad.javaeye.com/blog/post/387613
[解决办法]
思归博客提到的的IFRAME的方法,应该可以
http://blog.joycode.com/saucer/archive/2006/10/03/84572.aspx
[解决办法]
不同域当然不可以,建议用服务器代理访问

http://a2.net.com/main.htm:
<iframe name=abc src="http://a2.net.com/agent.php?url=http://a1.net.com/ttt.htm" > </iframe > 
<input type="text" name="bbb" value="0" / >
[解决办法]
在main.htm和aaa.htm的开头分别加上

document.domain='net.com'
如果引入了.js文件,那么,同样需要在开头加上document.domain='net.com'

这样域就统一了。OK
[解决办法]
document.domain= 'net.com ' 
不可以这么写
domain= 'net.com '

即使这样 firefox也不支持

[解决办法]
靠,欺负我打字慢,抢楼比我快
[解决办法]
who说firefox不支持呢,:)

楼主啊,慢慢调吧,已经不拒绝访问,你该给我分了,:)
[解决办法]
你可以控制parent.document的title的属性

我就是成功利用在document的title属性解决这中问题的...

热点排行