Pass response of AJAX only to current div among an array

前端 未结 2 1487
萌比男神i
萌比男神i 2021-01-28 05:19

I\'ve managed to make simple voting system with single current score. Everything is fine but the problem is that when I click on a button to vote for this particular

2条回答
  •  日久生厌
    2021-01-28 05:36

    You can't use $(this) inside success function as it will changes with context in which $(this) is called, you have to store the it in a var and then use it like below in your ajax success:

    
    

提交回复
热议问题