Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

jira issue collector

LuoyanXie I'm New Here Dec 29, 2021

Hello, I have a problem here.
When the jQuery get request failed, I set a reminder message. But JQuery always gives a prompt message after the page is loaded, how to modify it so that the user prompts the message after the click event. Below is my code:


##############1、js##############


jQuery.ajax({
  url: "<url>",
  type: "get",
  cache: true,
  dataType: "script",
  success: function(msg) {
      alert("success");
        },
   error: function(XMLHttpRequest, textStatus, errorThrown) {
      alert('error');
  }
});
window.ATL_JQ_PAGE_PROPS =  {
  "triggerFunction": function(showCollectorDialog) {
    jQuery("#button1").click(function(e) {
      e.preventDefault();     
    });
  }
}

##############2、vue##############
<button id="button1" class="feedback">report</button>

Thanks!

1 answer

0 votes
LuoyanXie I'm New Here Jan 11, 2022

The problem has solved!

###########################################################

$(document).ready(function() {
  $('#myCustomTrigger').click(function (event) {
jQuery.ajax({
  url: "<url>",
  type: "get",
  cache: true,
  dataType: "script",
  success: function(msg) {
      alert("success");
        },
   error: function(XMLHttpRequest, textStatus, errorThrown) {
      alert('error');
  }
});

window.ATL_JQ_PAGE_PROPS =  {
  "triggerFunction": function(showCollectorDialog) {  
      showCollectorDialog();
  }};
 });
});

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Software

👋 Looking for 15-20 volunteers to test Atlassian training content

Hi everyone! Are you interested in beta testing Atlassian University’s newest (unreleased!) training course? We’re looking for 15-20 volunteers to test our newest training course, Basic reporting...

459 views 19 23
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