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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,456,734
Community Members
 
Community Events
176
Community Groups

Adding java script to a wen item

Hi I'm working on a web item using script fragments. I know that we need to add JavaScript code for the button to perform some functionalities. I would like to know how to add the JavaScript to the rest end point. any sample code would be helpful

 

 

Thanks

1 answer

0 votes

REST end points do not have any use for javascript, as they are not intended to be used as a UI in a browser.

What are you actually trying to achieve here?

Hi, I was comming through the web item examples from adaptavist docs. In the advanced dialog section they have mentioned that we need to use javascript if we need complex wiring with the buttons we create. I would like to know how

(function ($) {
$(function () {
AJS.dialog2.on("show", function (e) {
var targetId = e.target.id;
if (targetId == "my-own-dialog") {
var someDialog = AJS.dialog2(e.target);
$(e.target).find("#dialog-close-button").click(function (e) {
e.preventDefault();
someDialog.hide();
someDialog.remove();
});
// etc
}
});
});
})(AJS.$);

 

where should I add this code to?

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events