JQuery events in dynamic content via ajax

Is there a way to dynamically load content using ajax and save any jquery functions that may have loaded materials?

For example, I would like to upload to Twitter, for example, a channel for database records. For each entry you can vote for thumbs or thumbs. Voting uses some AJAX, and I can’t save the functionality of the events when loading to the parent page.

ok excuse such a noob question, but I lost with an example on the jquery page. When he says:

$('a').click(fn); 
$('#mydiv').load('my.html',function(){ 
$('a').click(fn); });

what should fn represent?

+3
source share
1 answer
+9

Source: https://habr.com/ru/post/1765345/


All Articles