Answer the question
In order to leave comments, you need to log in
How to fix this error in ajax?
Good afternoon. To be honest, I don’t even understand what’s going on, I wrote the code a bunch of times, I’ve never seen this. The bottom line is that when I click on an object, an action should occur, so I wrote a quick code and made a test led any text. After clicking, the text appears, and immediately the problem disappears
. What could be the reason for this?
$('#gg').click(function(){
let gg = $(this).attr('id');
$.ajax ({
url:'temp/cards.php',
method:'POST',
data:{gg:gg},
success:function(data){
$('#card').html(data);
}
});
});
Answer the question
In order to leave comments, you need to log in
At you ajax gets from a cycle probably or other script influences. Check how many times this script is connected and how many times jquery is connected. In general, everything is ok with this code, the problem is elsewhere.
Open the console and see what's going on there. If there are endless requests, look to which script sends them.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question