I've come across an issue where the order in which prototype and jQuery are loaded cause issues. In the CMS, prototype is called first, then jQuery kindly lets it do its thing by running with noConflict.
However, I'm trying to use a TabSets outside of the CMS and for some reason unknown, jQuery is appearing before prototype. This causes prototype to semi-fail. Validators don't work properly, I get errors like "$ is not a function" etc. I guess it isn't surprising considering that TabSet loads the entire jQuery library just so it can use livequery, but uses prototype for all it's internal logic in (tabstrip.js).
I mean, surely whoever wrote this in TabSet.php felt a little bit dirty :D
public function FieldHolder() {
Requirements::javascript(THIRDPARTY_DIR . "/loader.js");
Requirements::javascript(THIRDPARTY_DIR . "/prototype.js");
Requirements::javascript(THIRDPARTY_DIR . "/behaviour.js");
Requirements::javascript(THIRDPARTY_DIR . "/prototype_improvements.js");
Requirements::javascript(THIRDPARTY_DIR . "/jquery/jquery.js");
Requirements::javascript(THIRDPARTY_DIR . "/jquery/jquery_improvements.js");
Requirements::javascript(THIRDPARTY_DIR . '/jquery/plugins/livequery/jquery.livequery.js');
Requirements::javascript(THIRDPARTY_DIR . "/tabstrip/tabstrip.js");
Requirements::css(THIRDPARTY_DIR . "/tabstrip/tabstrip.css");
return $this->renderWith("TabSetFieldHolder");
}
Anyway, is there any way for force javascript requirements to appear in a particular order. Since prototype refuses to play nicely, it is up to jQuery to save the day by loading second. Any tips appreciated.
Regards,
Hamish