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,297,305
Community Members
 
Community Events
165
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
Community showcase
Published in Apps & Integrations

Marketplace Partner Spotlight: AppLiger

This month the spotlight is on AppLiger. We caught up with Pavel Pavlovsky, CEO and Product Manager, to learn how the company started and what fuels the team's creativity.    Atlassian:...

375 views 0 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you