Title: Subscribe button keeps on loading.
Last modified: August 30, 2016

---

# Subscribe button keeps on loading.

 *  Resolved [BrianRayA](https://wordpress.org/support/users/brianraya/)
 * (@brianraya)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/subscribe-button-keeps-on-loading/)
 * Dear Support.
 * I am running one mc4wp form on my site in 3 different languages. English, German
   and Dutch. When you try to subscribe to the newsletter on the Dutch and German
   site the loading symbol/splash keeps on spinning and nothing happens, but when
   you try to subscribe to the English version everything works well.
 * I’ve compared the codes of the forms and they all the same except the descriptions
   and titels are in the language of the site (DE/ENG/NL).
 * When I run console on the .DE or .NL site it gives me this:
 *     ```
       XMLHttpRequest cannot load http://MYSITEURL.com/wp-admin/admin-ajax.php?mc4wp_action=subscribe. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://MYSITEURL.nl' is therefore not allowed access.
       ajax-forms.min.js:1 Object {readyState: 0, responseText: "", status: 0, statusText: "error"}
       ```
   
 * I find it strange that it suddenly doesn’t work after updating to 4.2.3.
 * Thanks in advance!
 * Brian
 * [https://wordpress.org/plugins/mailchimp-for-wp/](https://wordpress.org/plugins/mailchimp-for-wp/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Danny van Kooten](https://wordpress.org/support/users/dvankooten/)
 * (@dvankooten)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/subscribe-button-keeps-on-loading/#post-6427570)
 * Hi Brian,
 * The error is because, for some reason, your English site seems to be on another
   domain than your Dutch or German sites. The Dutch and German site will try to
   submit the form to your English site, which refuses it because by default, scripts
   can not submit to other forms (because of a security measure).
 * Do you have your languages split out over subdomains, by any chance? If these
   differing site URL’s are intentional, there are two ways to workaround this issue.
 * 1) In your server configuration, you can specify which URL’s are allowed to submit
   scripts to your site. You can do this by setting the `Access-Control-Allow-Origin`
   header.
 * You can do this by adding the following code snippet to your theme its `functions.
   php` (or to a plugin of its own).
 *     ```
       if( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
       	$allowed_origins = array(
       		'http://site.com',
       		'http://ge.site.com',
       		'http://nl.site.com'
       	);
       	$origin = ( isset( $_SERVER['HTTP_ORIGIN'] ) ) ? $_SERVER['HTTP_ORIGIN'] : '';
   
       	if( in_array( $origin, $allowed_origins ) ) {
       		// tell server origin is allowed
       		header("Access-Control-Allow-Origin: " . $origin );
       	}
       }
       ```
   
 * What it does is that it will check the script origin against a list of your allowed
   origins, and then tell the server to accept script submissions from all those
   sites.
 * 2) Disabling AJAX in your form-settings should fix the issue as well. This is
   not optional, of course.
 * A little technical perhaps, but I hope this helps. Unfortunately this is not 
   a straight plugin issue but rather a server configuration thing, you’d run into
   the same thing with other plugins submitting AJAX requests from your Dutch or
   German sites.
 * Let me know if I can be of more help!
 *  Thread Starter [BrianRayA](https://wordpress.org/support/users/brianraya/)
 * (@brianraya)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/subscribe-button-keeps-on-loading/#post-6427584)
 * Thanks for your reply but something went horribly wrong when I added your written
   code in the Functions.PHP Everything is gone. I can’t even get on WordPress anymore.
 * I interpreted your code like this
    if( defined( ‘DOING_AJAX’ ) && DOING_AJAX ){
   $allowed_origins = array( ‘[http://MYSITEURL.com&#8217](http://MYSITEURL.com&#8217);,‘
   [http://http://MYSITEURL.de&#8217](http://http://MYSITEURL.de&#8217);, ‘[http://MYSITEURL.nl&#8217](http://MYSITEURL.nl&#8217););
   $origin = ( isset( $_SERVER[‘HTTP_ORIGIN’] ) ) ? $_SERVER[‘HTTP_ORIGIN’] : ”;
 *  if( in_array( $origin, $allowed_origins ) ) {
    // tell server origin is allowed
   header(“Access-Control-Allow-Origin: ” . $origin ); }` }`
 * Could you tell me what happend cause im clueless and it broke everything.
 *  Plugin Contributor [Harish Chouhan](https://wordpress.org/support/users/hchouhan/)
 * (@hchouhan)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/subscribe-button-keeps-on-loading/#post-6427635)
 * Hello Brian,
 * We apologize for the late reply. Can you please let us know if you are still 
   facing this issue?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Subscribe button keeps on loading.’ is closed to new replies.

 * ![](https://ps.w.org/mailchimp-for-wp/assets/icon-256x256.png?rev=1224577)
 * [MC4WP: Mailchimp for WordPress](https://wordpress.org/plugins/mailchimp-for-wp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mailchimp-for-wp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mailchimp-for-wp/)
 * [Active Topics](https://wordpress.org/support/plugin/mailchimp-for-wp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mailchimp-for-wp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mailchimp-for-wp/reviews/)

## Tags

 * [form](https://wordpress.org/support/topic-tag/form/)
 * [loading](https://wordpress.org/support/topic-tag/loading/)
 * [multilangual](https://wordpress.org/support/topic-tag/multilangual/)

 * 3 replies
 * 3 participants
 * Last reply from: [Harish Chouhan](https://wordpress.org/support/users/hchouhan/)
 * Last activity: [10 years, 2 months ago](https://wordpress.org/support/topic/subscribe-button-keeps-on-loading/#post-6427635)
 * Status: resolved