Title: javascript not working &#8230;
Last modified: September 1, 2016

---

# javascript not working …

 *  [cielle](https://wordpress.org/support/users/cielle/)
 * (@cielle)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/javascript-not-working-18/)
 * Hello,
 * I want to use a randomising javascript on my site… to randomise some blocks of
   text…
 * I have used this successfully in the past on my site – but it wasn’t a multisite
   then…
 * Now I have a multisite installation and it is not working…
 * Could you possibly help me sort this out/work out why?? Do you need to see the
   code??
 * Thank you!!!

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

 *  [ThemeSumo](https://wordpress.org/support/users/themesumo/)
 * (@themesumo)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/javascript-not-working-18/#post-7709430)
 * Can you provide a link to your site please, and maybe show the code that you’re
   using to implement your script?
 * Thanks.
 *  Thread Starter [cielle](https://wordpress.org/support/users/cielle/)
 * (@cielle)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/javascript-not-working-18/#post-7709432)
 * yes! thank you! my site is [http://www.yeswearestars.gr](http://www.yeswearestars.gr)
 * the code ( i don’t have this on my site currently as it “broke” the page… )is
   this:
 *     ```
       function my_div_shuffler() {
       if (is_page(60)){
       	?>
   
       <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
   
       <script>
       (function($){
       $.fn.shuffle = function() {
       var allElems = this.get(),
       getRandom = function(max) {
       return Math.floor(Math.random() * max);
       },
       shuffled = $.map(allElems, function(){
       var random = getRandom(allElems.length),
       randEl = $(allElems[random]).clone(true)[0];
       allElems.splice(random, 1);
       return randEl;
       });
       this.each(function(i){
       $(this).replaceWith($(shuffled[i]));
       });
       return $(shuffled);
       };
       })(jQuery);
       </script>
   
       <script type="text/javascript">
       $(document).ready(function() {
              $('div.deeppink,div.white,div.hotpink,div.pink,div.orchid,div.plum,div.turquoise,div.violet').shuffle();
        });
        </script>
   
       <?php
       	}
       }
       add_action('wp_head', 'my_div_shuffler');
       ```
   
 *  Thread Starter [cielle](https://wordpress.org/support/users/cielle/)
 * (@cielle)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/javascript-not-working-18/#post-7709434)
 * ok ok !! I am so sorry, this appears to now be working!!! I don’t even know what
   i did, it must have been something that i had not put in the correct place or
   something in my custom.php…
    so sorry, thank you so much for your time and help!
   Obviously, just my focus here with your help solved this!
 *  [ThemeSumo](https://wordpress.org/support/users/themesumo/)
 * (@themesumo)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/javascript-not-working-18/#post-7709436)
 * Great, glad to hear it.
 *  Thread Starter [cielle](https://wordpress.org/support/users/cielle/)
 * (@cielle)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/javascript-not-working-18/#post-7709442)
 * thanks again…

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

The topic ‘javascript not working …’ is closed to new replies.

## Tags

 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [mulitisite](https://wordpress.org/support/topic-tag/mulitisite/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
 * 5 replies
 * 2 participants
 * Last reply from: [cielle](https://wordpress.org/support/users/cielle/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/javascript-not-working-18/#post-7709442)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
