WordPress.org

Ready to get started?Download WordPress

Forums

Easy MailChimp Forms
[resolved] Doesn't work in IE; why including jQuery? (4 posts)

  1. jamesvl
    Member
    Posted 1 year ago #

    On two different computers the plugin fails with IE9. Works fine under FF and Chrome. The JS or AJAX call fails and the success message is never shown.

    Also, per this comment, WP updates include the latest version of jQuery - shouldn't this plugin just follow best practices and reference that, instead of trying to include its own (outdated) version?

    http://wordpress.org/extend/plugins/yikes-inc-easy-mailchimp-extender/

  2. jamesvl
    Member
    Posted 1 year ago #

    Correction: I see the plug-in doesn't actually include jQuery on its own, it just has the file in its repository. My mistake.

    Haven't delved into the code yet, but I guess you're including and using Prototype instead of jQuery?

  3. jamesvl
    Member
    Posted 1 year ago #

    Resolved

    The AJAX request was failing on IE because my WP site had its admin_ssl turned on.

    A visitor on the site using http would be given the MailChimp form and the AJAX call would go to the https version of the site.

    That cross-domain request (from http or https, even on the same domain) works in FF and Chrome, but fails in IE8 and IE9. (May not be an issue in IE10.)

    The Fix

    I had to adjust the call to admin_url() in the main plugin file, based on the server's port.

    This will let the script work on both http and https versions of the site, and falls back to the old behavior if you're running on a non-standard port.

    if(!defined('YKSEME_URL_WP_AJAX')) {
       if ($_SERVER['SERVER_PORT'] == 80)
           define('YKSEME_URL_WP_AJAX', admin_url('admin-ajax.php', 'http'));
       else if ($_SERVER['SERVER_PORT'] == 443)
          define('YKSEME_URL_WP_AJAX', admin_url('admin-ajax.php', 'https'));
       else
          define('YKSEME_URL_WP_AJAX', admin_url('admin-ajax.php'));
    }
  4. yikesinc
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Jamessvl,

    Thanks so much for posting the fix. We will add it to our to-do list of the next release of the plugin.

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags