According to the jQuery website:
Starting in b2evolution version 2.0, there is a function to allow skins and plugins to include jQuery when a blog is displayed.
‘’The rest of this manual page only applies to b2evolution version 2.0 and higher.'’
Using jQuery in a plugin
<?php require_js( ‘#jquery#’ ); ?>
This will make sure that jQuery is added to the page, but if another plugin (or the skin) has already asked for jQuery, then it will only be added once.
Using jQuery in a skin
In your skin’s main.tpl.php file, find this line:
skin_include( ‘_html_header.inc.php’ );
and right above it, add this:
require_js( ‘#jquery#’ );
Incompatible with Prototype
If your plugin uses [http://www.prototypejs.org/ Prototype], and another plugin on the same blog uses jQuery, there could be a conflict. The best practice is to port your code to jQuery. You’ll have less chance of conflict and better use of bandwidth. Otherwise, consult this [http://docs.jquery.com/Using_jQuery_with_Other_Libraries document about how to make them work together].
jQuery itself can be extended with [http://jquery.com/plugins/ plugins].
TODO: Work up some code that checks in the $required_js variable to see if the jQuery plugin has already been added by another b2evolution plugin.
Created by • Last edit by on Nov 09, 2012
No feedback yet
Form is loading...