WordPress.org

Ready to get started?Download WordPress

Forums

WordPress.com Stats pollute the js namespace (3 posts)

  1. gonchuki
    Member
    Posted 6 years ago #

    I just got struck by an ugly implementation in the WordPress.com Stats plugin that deliberately adds functions to the global namespace polluting it and clashing against mootools, thus breaking the library at least under IE, Safari and Opera (Gecko-based browsers seem to give preference to the mootools implementation of addEvent).

    For sanity and future proofness, I would suggest you to encapsulate your functions in a private namespace, as you are not only colliding with mootools, but also any other library out there implementing an addEvent function in the global namespace (DOM Assistant comes to mind right now, there may be more)

    If you need help on the javascript end just go to that ugly contact form in my blog and I will gladly contribute with a fix.

  2. moshu
    Member
    Posted 6 years ago #

    You may have better luck on the hackers or testers list http://lists.automattic.com/mailman/listinfo
    that's the place where the developers are.
    They rarely read the forum.

  3. gonchuki
    Member
    Posted 6 years ago #

    thanks, I ended hoping through websites and finally submitted a ticket on the plugins trac http://dev.wp-plugins.org/ticket/723

Topic Closed

This topic has been closed to new replies.

About this Topic