2012-11-23 111 views

回答

0

要创建动态ALOHA实例:

$(document).ready(function(){ 
// Add an editable upon clicking on some button Button 
$("#Button").click(function() { 
    var $ = Aloha.jQuery; 
    $('#somewhere').append('<div class="editable" id="ed" ></div>'); 
    Aloha.jQuery('.editable').mahalo(); 
    Aloha.jQuery('.editable').aloha(); 
}); 

现在,你可以简单地获取内容:

var e = Aloha.getEditableById('ed'); 
getContents(); 

我没有测试它,但它应该工作。