Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

jira issue collector

LuoyanXie
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 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
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 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