Search code examples
mootoolsfirefox4drop-down-menu

mootools and firefox 4 problem


I was working on a site some months ago and I used mootools menumatic from one of the resources sites from the internet.Firefox 4 was still beta at that time and I didnt tested my menu in it and currently i tested in firefox 4 and amazingly the script didnt work.where might be the problem.Thanks in advance.enter link description here


Solution

  • you use mootools 1.2.0 - just so we are clear on a few things here, and I am repeating myself but there you go...

    1. mootools 1.2.0 is now 3 years old - http://ajaxian.com/archives/mootools-12-released - june 13th 2008. at the time of release, firefox 4 was not even a design concept.

    2. mootools 1.2 relied on feature detection - read the previous thread linked above - and on the now deprecated getBoxObjectFor to determine if you were in a gecko-based browser like FireFox. Running this small test in FF4 on your site:

    (via the firebug console):

    JSON.encode(Browser.Engine);
    "{"name":"unknown","version":"","unknown":true}"
    

    Bottom line is, the menu works but it creates a javascript exception when trying to use specific style setters/getters that will fail due to the framework not understanding the browser version. This is likely NOT going to be the only error but you will need to write some extensive tests to catch all problems as many may result in different/undesired functionality rather than outright exceptions.

    In short, the answer you may not want to hear: upgrade your mootools to AT LEAST 1.2.5.1 or ideally, 1.3.2 - you may need to use the compatibility mode version so your old plugins continue to work.

    Other breaking changes: Function.bind used to take args of bindObj, [args] and is now natively defined as bindObj, arg1,... argn

    And finally, you may want to accept some answers, 50% is way too low