“Access is denied” error on accessing iframe document object

后端 未结 7 1301
生来不讨喜
生来不讨喜 2020-12-05 02:35

For posting AJAX forms in a form with many parameters, I am using a solution of creating an iframe, posting the form to it by POST, and then accessing the

7条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-05 03:27

    if it is a domain issue (or subdomain) such as www.foo.com sending a request to www.api.foo.com

    on each page you can set the

    document.domain = www.foo.com
    

    to allow for "cross-domain" permissions

提交回复
热议问题