PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Need to set document.domain for Ajax-enabled submissions

  1. I am running a site ( that uses iframes from a subdomain (

    In order to communicate between them (due to same-origin policy) I need to set the JavaScript variable document.domain = '' . This is all fine and works great.

    However, when Gravity Forms in introduced, the Ajax-enabled submissions fail (because presumably the Ajax code returned that gets loaded into the hidden GF iframe expects the standard

    Sadly, browsers do NOT let you reset the document domain back to the original, once you have set it to the superdomain.

    Long story short: I need to be able to insert the document.domain code into the HTML returned by the Ajax submission of a form. I don't see a JavaScript hook for such a thing. Is there a way to do this via a PHP hook?

    I know I can just turn Ajax off and it'll work, but that's not an elegant solution.

    Any advice would really be appreciated! Thanks.

    Posted 11 years ago on Friday June 21, 2013 | Permalink
  2. **Bump**

    Any advice on this?

    Posted 11 years ago on Sunday June 30, 2013 | Permalink
  3. I'll see if the dev team has any ideas for you here.

    Posted 11 years ago on Monday July 1, 2013 | Permalink
  4. Can you fill out a priority support form for me here and include WP Admin login and a link to the page where the form is on.

    Posted 11 years ago on Wednesday July 3, 2013 | Permalink

This topic has been resolved and has been closed to new replies.