I need a way to use the jquery .live() function to act on elements that are loaded via ajax.
For instance a div is loaded via ajax .load()<
Typically I would handle any actions that occur when the element is loaded either as part of the AJAX callback mechanism or as part of a ready handler that is included in the returned HTML of the AJAX success callback. The later works well when you want to load a partial view onto the page and want to keep the code with the partial view itself.
Partial View:
...
Using the callback
$.ajax({
url: '/example.com/code.php',
success: function(html) {
var container = $('#container').html(html);
$('#myDiv',container).somePlugin( ... );
}
});