Why following doesn't work:
$(function()
{
    $('#settings').on('click', '.link', function(e)
    {
        e.preventDefault();
        alert('okay');
    });
});
...when just prepending body to selector makes it work?
$(function()
{
    $('body #settings').on('click', '.link', function(e)
    {
        e.preventDefault();
        alert('okay');
    });
});
This code is executed by $.getScript(...) call just after #settings is inserted into DOM by $('body').append(...).
I want to use .on() since .links can be created dynamically and I don't want to rebind events all over the place.
Browsers affected: Firefox, Chrome, possibly more
JQuery version: 1.11.0
 
     
    