• Resolved alienintheheights

    (@alienintheheights)


    After upgrading my site to 3.6 yesterday, the Events Manager plugin, which was working, now breaks upon submit:

    ReferenceError: EM is not defined
    url: EM.bookingajaxurl,

    The error is clearly due to some unnecessary escaping happening in the CDATA tag where the EM variable is defined. As you can see (and I’m only showing part of it), everything is overly escaped and as such, the line breaks throw off the balance of quotes, creating a parsing error on the EM var itself. Hence, the JS error seen when trying to submit the form.

    <script type='text/javascript'>
    /* <![CDATA[ */
    var EM = {"ajaxurl":"http:\/\/MYSITE.com\/wp-admin\/admin-ajax.php","locationajaxurl":"http:\/\/MYSITE.com\/wp-admin\/admin-ajax.php?action=locations_search"
    .... (ETC)....
    "","bookingInProgress":"Please wait while the booking is being submitted.","tickets_save":"Save Ticket",
    ... (ETC)
    };
    /* ]]> */
    </script>

    I’m not blaming the plugin. I’m sure it’s a something amiss in the theme template, or perhaps in my config. But I’m not a WP expert, so I’m not sure where to look. I’m happy to hack code if needed. Just give me a nudge in the right direction.

    Thanks in advance.

    http://wordpress.org/plugins/events-manager/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter alienintheheights

    (@alienintheheights)

    Figured it out. User error.

    The wp_head() directive in my theme’s header.php got misplaced inside a pair of style tags, thus the script wasn’t executing. Moved it out and everything was happy again. The escaping I reported is apparently normally (per a WP support ticket I found) though Firebug didn’t like it when I copy/pasted it into the console (=red herring).

    Thanks.

    Plugin Support angelo_nwl

    (@angelo_nwl)

    thanks for the update.

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

The topic ‘ReferenceError: EM is not defined’ is closed to new replies.