Code Guru

Code Guru

By James Seavers

Monday, 14 January 2013

Firefox 18 breaks Mootools

Firefox 18 breaks Mootools

Got a Mootools element that has suddenly broken, or is not working in Firefox? If this has happened recently, after the launch of Firefox 18, read on.

If you know us, you know that we use Joomla, which brings lots of benefits, but also causes some headaches (all content management systems do!).

A real issue with Joomla is that they have used, and continue to use, Mootools as it's built-in Javascript library of choice. Not that there's anything wrong with Mootools, it's a good Javacsript library. However, the Javascript library of choice for most developers, including those in the Joomla community, is jQuery, which means that allot of Joomla extensions run jQuery which can cause lots of conflict problems. This is slightly off topic here, but worth knowing.

So, the version of Mootools that Joomla 1.5 is shipped with does't work with the latest version of Firefox, FF18. For us, components such as Frontpage Slide Show broke in FF18 across some of our sites.

What to do, well, the fix is relatively simple, and comes courtesy of the Google Group community -!msg/mootools-users/W7MHwTFHYQ4/B4HcR951XQYJ.

Just add the following code snippet before you load Mootools:

<script type="text/javascript">
     String.prototype.contains = function(string, separator){

return (separator) ? (separator + this + separator).indexOf(separator + string + separator) > -1 : String(this).indexOf(string) > -1;


Happy Mootooling!

Comments (10)

  • Jamie

    01 February 2013 at 13:41 |
    Brilliant, been scratching my head with regards to this for hours. Thank you!!
  • Mike

    05 February 2013 at 10:09 |
    We are glad we could help Jamie!
  • Carmen

    07 February 2013 at 17:10 |
    I too had been scratching my head for hours...I CANNOT THANK YOU ENOUGH!
  • Mike

    26 February 2013 at 22:39 |
    We're glad that we could help you also Carmen. Looks like the Code Guru is on a roll!
  • sam

    05 March 2013 at 13:35 |
    Great :) Thanks a lot !
    • Mike

      06 March 2013 at 09:41 |
      Your welcome Sam, we're glad we could help :D !
  • Tim

    10 April 2013 at 18:24 |
    Thank You. Your snippet has resolved a problem I've been fighting for awhile. I'm sure you just saved me many future hours!
    • Mike

      11 April 2013 at 09:02 |
      Tim your very welcome!
  • Luca

    21 July 2013 at 13:13 |
    Thank you, your script saved me a lot of trouble!
  • David

    22 July 2013 at 08:58 |
    Glad we could help Luca

Leave a comment

You are commenting as guest.

Latest Big Bad Blog Post

ExpressionEngine Force HTTPS For Selected Sections with Htaccess

ExpressionEngine Force HTTPS For Selected Sections with Htaccess

Have you ever wanted to force a HTTPS connection for your ExpressionEngine website? If so, you may have also wanted to 'unforce' that connection for other areas of your website, either for performance issues or because maintaining both HTTP and HTTPS for the same section can be tricky. Avoid those pesky browser warnings about unsafe (non HTTPS) assets with this htaccess rewrite.

Continue Reading

Latest twitterings

  • @reverseRett proud Daddy and Uncle!!xx-- Delivered by Feed43 service

    27 May 2014 | 11:40 am View full tweet
  • Check out "Internet Archive" on Vimeo  #Vimeo-- Delivered by Feed43 service

    24 May 2014 | 1:03 pm View full tweet

Fill in our contact form

  • Please complete all the fields

Thanks for your message! We will get back to you ASAP!

* indicates a required field