Adding java script to a wen item

Pradeep A July 8, 2021

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
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 8, 2021

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?

Pradeep A July 8, 2021

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

Pradeep A July 9, 2021

(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
AUG Leaders

Atlassian Community Events