2009-09-07 55 views
0

我已經通過javascript加載了一個<textarea>如何用jQuery提供某些功能?

並且需要在它可用時立即關注它。

活()jQuery中必須指定一個「型」不存在於我的情況。

我需要做類似如下:

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

如何用jQuery實現這個?

+0

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

回答

2

使用的回調:

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

其實我在做這樣的事情: $( '#裝載機')的clone()removeAttr( 'ID')的負載( 「查看/ chatBox.html」)appendTo( '主體')。; – omg

+2

您仍然可以在那裏添加回調 –

相關問題