1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed Upgrade jQuery

Discussion in 'Resolved Bug Reports' started by digitalpoint, Dec 23, 2011.

  1. digitalpoint

    digitalpoint Well-Known Member

    I know upgrading jQuery within XenForo is on the to-do list at some point, but figured I would make an "official" report so it doesn't get forgotten...

    jQuery versions less than 1.7.0 utilize event.layerX and event.layerY, so now we end up with deprecated notices in Chrome on every page view in XenForo due to the old version of jQuery:
    Code:
    event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
    It was fixed in jQuery 1.7.0: http://bugs.jquery.com/ticket/10531

    The jQuery Tools that XenForo uses has been "officially" updated to support jQuery 1.6.4, but I've been running it on some stuff with jQuery 1.7.1 without any problems.
    erich37, Adam Howard, Alien and 3 others like this.
  2. Fuhrmann

    Fuhrmann Well-Known Member

    Yes, I noticed that warn in the console log too.
    mrGTB likes this.
  3. BamaStangGuy

    BamaStangGuy Well-Known Member

    I wish xenForo would make it easier for us to choose what version of jQuery we want to run without making code edits.

    I simply run: http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js on all my sites. Sure it might break something eventually, but its my choice and keeps me updated with the latest version automatically.
  4. Mike

    Mike XenForo Developer Staff Member

    The reason that we don't upgrade jQuery instantly is that every time does require code edits to fix the BC breaks -- we have a lot of stuff built on top of it.
  5. BamaStangGuy

    BamaStangGuy Well-Known Member

    Gotcha.
  6. digitalpoint

    digitalpoint Well-Known Member

    It's not practical to auto-update... sometimes there are incompatible changes. For example when 1.6.0 added the prop() function, and made some of the old attr() not function the same any longer.

    Auto-updating jQuery on a commercial product that simply could break because of the new version of jQuery would be a support nightmare.

    That being said, jQuery is pretty good about maintaining backward compatibility... the only thing I've ever personally had to "fix" after updating to the newest version was when prop() was introduced in 1.6.0.
  7. Adam Howard

    Adam Howard Well-Known Member

    yes, please
  8. ragtek

    ragtek Guest

    Insy, HWS, Adam Howard and 1 other person like this.
  9. Vincent

    Vincent Well-Known Member

  10. Andy.N

    Andy.N Well-Known Member

    Just use Google CDN to get the latest.
  11. Adam Howard

    Adam Howard Well-Known Member

    Google CDN will only pull 1.5.2 because it is hard coded inside XenForo

    The last time I tried to use a newer version... TinyMCE (the editor) and a few other things... Didn't like it.

    XenForo seems to have far to many build in dependences. This is something I don't understand because I could change this in vBulletin, phpBB, WordPress, SMF, and even dare I say it... IPB. Yet XenForo has this so coded in that adding another jQuery version, screws things up.

    BUT if you want to try to do it....

    /library/XenForo/Application.php

    PHP:
    public static $jQueryVersion '1.5.2';
    IF you're doing a local hosting, you need to upload the current version to

    /js/jquery
  12. digitalpoint

    digitalpoint Well-Known Member

    The version of jQuery Tools that XF is using doesn't work with the newer versions of jQuery. So jQuery Tools would need to be updated as well... and the new version isn't a drop-in replacement (I tried).
  13. Adam Howard

    Adam Howard Well-Known Member

    Current version of jQuery Tools still recommends jQuery 1.7.2, but that has an issue with TinyMCE any ways (see TinyMCE's website).

    As I said... To many version dependences built in.
  14. digitalpoint

    digitalpoint Well-Known Member

    Yeah, but XF doesn't use the current version of jQuery Tools, they are using one that required jQuery 1.5.x (breaks with jQuery 1.6+). Which of course was the current version when they added it to XenForo, so not like they added an old version at the time.

    And considering jQuery 1.8 just came out yesterday (I think), the newest jQuery Tools might work with it... probably haven't even had time to test it yet.
  15. Adam Howard

    Adam Howard Well-Known Member

    I'll bite....

    ..... Where is the jQuery Tools in XenForo?
  16. ragtek

    ragtek Guest

    Adam Howard likes this.
  17. Adam Howard

    Adam Howard Well-Known Member

    simbolo likes this.
  18. NeoCHI

    NeoCHI Active Member

    So is there no way to use a newer jquery?

    I'm trying to make a simple image slider that's touch enabled but it seems like its only availabe in jquery 1.7 + ... anyone know of any other options?
  19. Alfa1

    Alfa1 Well-Known Member

    jQuery 2.0 beta-2 Released

    Since jQuery 2 is well on its way, it may be best to wait a little longer and implement that.
    There is a problem with that though: jQuery 2 does not support IE8 or lower. Currently IE8 is still used widely.
    Adam Howard likes this.
  20. tyteen4a03

    tyteen4a03 Well-Known Member

    1.9 and 2 shares the same API, so we can upgrade to 1.9 and when IE8 goes past advertised lifetime (the whole IE series is past its lifetime anyways) we can upgrade to the 2.x series.

Share This Page