There could be several reasons why the $this.click() function is not working on Ajax success. Here are a few possible solutions:

  1. Ensure that the $this variable is referencing the correct element. You might want to use a more specific selector or check if the variable is correctly assigned.

  2. Verify that the event binding is happening after the Ajax success. Sometimes, if the event binding is done before the element is loaded or created, it may not work as expected. Move the event binding code inside the Ajax success function or use event delegation to bind the event to a parent element.

Example using event delegation:

$(document).on('click', '$this', function() {
  // Your click event code here
});
  1. Double-check if the Ajax success function is being triggered. Use console.log or debugging tools to see if the success function is executing correctly.

  2. Check for any errors in the console log. There might be other JavaScript errors that are preventing the click event from working. Fixing those errors could potentially resolve the issue.

  3. Make sure that the element you are trying to bind the click event to exists in the DOM at the time of binding. If the element is dynamically created or loaded, you may need to use a callback or promise to ensure that the element is present before binding the event.

If none of these solutions solve the issue, please provide more details and code snippets for further assistance

click on $this not working on ajax success please help in jquery