Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How do you use jQuery in a Fisheye servlet plugin template?

Baron Roberts July 12, 2011

I am trying to use jQuery in my Fisheye servlet plugin but cannot seem to find any documentation on how to make it available. I see a #requireResource directive for my template but it refers to confluence's jquery. Trying that and changing confluence to fecru did not work either.

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
jhinch (Atlassian)
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 12, 2011

jQuery is included into every page as part of AUI (Atlassian UI). jQuery can be access via the AJS.$ or AJS.jQuery variables

0 votes
Baron Roberts July 13, 2011

Am new to jQuery so a little learning was in order. I see that my third party's code follows jQuery best practice and effectively has its $ passed in.

0 votes
Baron Roberts July 13, 2011

Thanks for the reply Jason! I assume that if I have a third party component that is based on jQuery that I would have to edit the "$" in their code to use "AJS.$".

jhinch (Atlassian)
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 14, 2011

Generally speaking you probably want to wrap your code in a closure

(function($) {
// Code goes here
})(AJS.$)

and continue to use $ in your code but if you want to you can replace all usages of $ with AJS.$

TAGS
AUG Leaders

Atlassian Community Events