jquery 部分基础语法

Original 2019-01-10 16:36:38 262
abstract:页面就绪后 调用 getDevList() 获取数据显示在表格 tbody里 $(document).ready(function () {                 getDevList();           &nbs

页面就绪后 调用 getDevList() 获取数据显示在表格 tbody里

 $(document).ready(function () {
                 getDevList(); 
            });
            
function getDevList() {
    try {                  
        $.post("getDevlistC.php?mtrick=cucall&openid=<?php echo $szopenid; ?>&devname=" , function (result) {
        
            if (result.length > 20) {	               
                $(".devcont tbody").html(result);	              
              
            } else {
                $(".ta_list tbody").html("<tr><td colspan='8'>搜索结果:0条记录。</td></tr>");
            }
        }) 
    } catch (e) 
    {
    alert(e);
     }
}


Correcting teacher:查无此人Correction time:2019-01-10 16:41:05
Teacher's summary:你这地址很个性,写的不错。代码里,用if判断就行了。 不需要抛出错误try。加油

Release Notes

Popular Entries