Plugin JQ
This Wiki Plugin allows JQuery Javascript code to be inserted on a page.
Table of contents
Usage and Parameters
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:
{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:
$("p").show("slow");
When using the Tiki JQPlugin in versions 3 to 5, you need to start you code with jq:
$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:
{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/
Related pages
Contributors to this page: xavi
,
pascalstjean
and
lindon
.
Page last modified on Wednesday 01 September, 2010 13:11:47 UTC by xavi
.
