[wp-trac] [WordPress Trac] #19102: Javascript execution in MU

WordPress Trac wp-trac at lists.automattic.com
Tue Nov 1 17:35:41 UTC 2011


#19102: Javascript execution in MU
--------------------------+-----------------------------
 Reporter:  johncolvin    |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Multisite     |    Version:  3.2.1
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 I've reproduced this issue on 4 separate MU installs. I'm trying to use a
 jQuery slider, but keep getting an undefined method error.

 I'm enqueueing scripts according to the wordpress docs. I can see that the
 scripts are being loaded through the Chrome developer panel. When the
 method is called on an element, it produces a undefined method error. I
 can verify that the javascript that powers the slider is being run because
 I put alerts before and after it and saw both of those. If I run the
 slider method declaration from the console in the developer panel and then
 call the slider function on the element, everything works. So, it seems
 that the JS is running, but is then somehow being reset.

 To confirm that this is an issue with MU, I can disable MU and just run my
 main site. When I do this, without changing any code, the slider works as
 expected.

 I've tried enqueueing the scripts on a variety of actions including
 wp_head, init and template_redirect.

 I've had this same javascript issue with all libraries I've tried to add.
 This issue can be reproduced easily with a single user instance of
 wordpress by installing the anything slider plugin, add some jQuery like:

 jQuery(document).ready(function(){
   jQuery('#slider').anythingSlider();
 });

 confirm that the slider works, go through the steps to enable MU. The
 slider should be broken after that.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19102>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list