2009-09-07 6 views
0

J'ai chargé un <textarea> avec javascript,Comment faire quelque chose quand il est disponible avec jQuery?

et j'ai besoin de me concentrer dès qu'il est disponible.

Le live() dans jQuery doit spécifier un "type" qui n'existe pas dans mon cas.

que je dois faire quelque chose comme ci-dessous:

$('#target').onAvailable($('#target').focus()); 

Comment mettre en œuvre cela avec jQuery?

+0

http://stackoverflow.com/questions/1387414/is-there-a-onavailable-function-in-jquery – bastianneu

Répondre

2

Utilisez un rappel:

$("...").load("/something/to/load.html", function() { 
    $("textarea", this).focus(); 
}); 
+0

En fait, je fais quelque chose comme: $ ('# loader'). clone(). removeAttr ('id'). load ("Vues/chatBox.html"). appendTo ('body'); – omg

+2

vous pouvez toujours ajouter un rappel là-bas –

Questions connexes