跨子域iframe和JavaScript [英] Cross sub domain iframes and JavaScript

查看:106
本文介绍了跨子域iframe和JavaScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用CMS网站,其网域是:

I am working on a CMS site who's domain is:

http:// www .acmssite.com

他们有一个子域,用于存储表单系统:

They have a sub-domain where they store a form system:

http://www.forms.acmssite.com

我有一个iframe在第一个看起来在后者的形式。

I have an iframe on the first that looks at a form in the latter.

我需要运行脚本来操纵后者从前者,并想知道这是可能吗? / p>

I need to run scripts to manipulate the latter from the former and was wondering is this possible?

推荐答案

为了不受同一源策略的限制,您可能需要在两个页面中执行此操作:

In order for this to not be restricted by the same origin policy, you will probably need to do this in both the pages:

document.domain = "acmssite.com";

这篇关于跨子域iframe和JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆