[Show/Hide Right Column]

Insert JQuery Javascript
Print

Plugin JQ

This Wiki Plugin allows JQuery Javascript code to be inserted on a page.

Usage and Parameters

exclaim The JQuery feature must be enabled for this plugin to work. Go to Admin Home > Features > Experimental > JQuery (checkbox) to enable the feature.

With the feature enabled, use this syntax to use the plugin:

Syntax for the JQ plugin
{JQ(notonready=> , nojquery=> )}JQuery Javascript code{JQ}

Parameter Accepted values Default Effect Required Input? Since
notonready true or false false Executes inline rather than when document is ready when set to true n
nojquery HTML markup text "<!-- jq smarty plugin inactive: feature_jquery off -->" Notofication text when permission for using JQuery has not been turned on n

Example

A Simple JQuery line of code looks like this:

Standard JQuery
$("p").show("slow");

When using the Tiki JQPlugin in versions 3 to 5, you need to start you code with jq:

TikiWiki JQuery Call
$jq("p").show("slow");

So that, for instance, if we want to pre-load some values in a tracker plugin form, where you have text field id's 20, 21, 22, and a textarea field id 23, and you want some text to be preloaded in the fields 22 and 23 of your form, we can use something like in a tiki 3, 4 or 5 site:

Jquery code in Tiki3, 4 & 5 to add in the wiki page where the tracker plugin call is located
{JQ()}
$jq("#track_22").val("foo or bar");
$jq("#area_23").val("first line of text\nsecond line\nthird line");
{JQ}

For more tips and tricks using Jquery, visit: http://api.jquery.com/browser/


Contributors to this page: xavi36278 points  , pascalstjean382 points  and lindon2331 points  .
Page last modified on Wednesday 01 September, 2010 13:11:47 UTC by xavi36278 points .

Find by Page Name

Exact match

Keywords

The following is a list of keywords that should serve as hubs for navigation within the Tiki documentation and should correspond to development keywords (bug reports and feature requests):