javascript函数中未显示文本

javascript函数中未显示文本,javascript,jquery,datatable,Javascript,Jquery,Datatable,这是我的jquery $(document).ready(function() { $('.test').text('Hello'); }) 此外,我的javascript函数 function format ( d ) { // `d` is the original data object for the row return '<div class="slider">'+ '<table cell

这是我的jquery

$(document).ready(function() {
        $('.test').text('Hello');
})
此外,我的javascript函数

 function format ( d ) {
        // `d` is the original data object for the row
        return '<div class="slider">'+
            '<table cellpadding="5" cellspacing="0" border="0" style="padding-left:50px;">'+
            '<tr>'+
            '<td>Full name:</td>'+
            '<td>'+d.name+'</td>'+
            '</tr>'+
            '<tr>'+
            '<td>Extension number:</td>'+
            '<td>'+d.extn+'</td>'+
            '</tr>'+
            '<tr>'+
            '<td colspan="2"><div class="test"></div></td>'+
            '</tr>'+
            '</table>'+
            '</div>';
    }
函数格式(d){
//`d`是该行的原始数据对象
返回“”+
''+
''+
'全名:'+
''+d.name+''的+
''+
''+
'分机号码:'+
“+d.extn+”+
''+
''+
''+
''+
''+
'';
}
当我在format函数中调用测试类时,“Hello”文本不显示,但我编写的纯文本如下。。。然后就出现了

任何人都可以帮助我

###重要##
格式化函数使用其他位置

您不能使用
$('.test')更改文本。文本('Hello')此选项。
您可以在添加文本时添加延迟,如

$(document).ready(function() {
    $('.test').delay(1000).text('Hello');
})

您需要将html插入DOM中进行操作。