onavailable

Is there a onAvailable() function in jQuery?

After inserting new html to DOM,I need to add some listeners to it. But the new elements are not available at once. My code: $('#loader').clone().removeAttr('id').load("Views/chatBox.html").appendTo('body'); $('#chat') .focus(function() { $(this).addClass('jV'); }) .blur(function() { $('#chat').removeClass('jV');...

How to do something when available with jQuery?

I've loaded a <textarea> with javascript, and need to focus on it as soon as it's available. The live() in jQuery must specify a "type" which doesn't exists in my case. I need to do something like below: $('#target').onAvailable($('#target').focus()); How to implement this with jQuery? ...