WordPress.org

Support

Support » Plugins and Hacks » [Resolved] JavaScript error when Events Manager event is draft

[Resolved] JavaScript error when Events Manager event is draft

  • webaware
    Participant

    @webaware

    G’day,

    Using Events Manager, with an event created by another user and saved as a draft, I get a JavaScript error — analyticsFileTypes is not defined. This breaks other script on the page.

    It happens because is_preview() is true, so the GA script block isn’t loaded, but external-tracking.min.js is still loaded and executes, generating the error.

    To fix, I wrapped the code within the ready handler function in a test:

    // only if GA script block has been loaded
    if (typeof analyticsFileTypes != "undefined") {
    ...
    }

    I’d appreciate it if you could add this to your next release.

    cheers,
    Ross

    http://wordpress.org/extend/plugins/google-analyticator/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] JavaScript error when Events Manager event is draft’ is closed to new replies.