用js修改iframe中的数据。chrome报错Unsafe JavaScript attempt to access frame with URL http://www.ab.cc/index.php?app=verify&act=normal from frame with URL http://www.ab.cc/index.php?app=tb&act=uploadpic&pic=face. Domains, protocols and ports must match.谁能告诉我为什么这也不行,域名一致啊

解决方案 »

  1.   

    相关的出错代码var picurl = $(window.frames["uploadPicture1"].document).find("#flashPreview img").attr("src");$("#uploadPicture2", parent.document).height("140px");
      

  2.   

    参考:
    http://stackoverflow.com/questions/364952/jquery-javascript-accessing-contents-of-an-iframeiframe 必须同域名。
      

  3.   

    跨域了哪个浏览器都无法操作iframe
      

  4.   

    问题倒是解决了。手动给document.domain赋值就行了。
    但就是想不通啊,iframe原本就是同域名啊