I\'ve come to maintain a piece of javascript that downloads some JSON data from the server, builds a new table row (like $(\'
) and inserts i
EDITED
The .on() should be set up like this to work with dynamically created elements. Also, make sure to use Jquery version 1.8 (newest release)
Also, you need to prevent the standard action of the click if you don't want to scroll to the top.
Here is a working FIDDLE
var a = $('ASD');
a.appendTo($("body"));
$('body').on('click', 'a', function(e) {
e.preventDefault();
$(this).after('
ASD');
});