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!