/**

    • 判断是否null
    • @param data
      */

    function isNull(data){

    return (data == “” || data == undefined || data == null) ? “暂无” : data;

    }

    var content=$(“content”).val();
    if(!content){
    alert(“请输出内容!”);
    return;
    }
    //上述内容相当于判断content=””、content=null、content = undefined、content=0
    //判断字符是否为空的方法
    function isEmpty(obj){
    if(typeof obj == “undefined” || obj == null || obj == “”){
    return true;
    }else{
    return false;
    }
    }
    if (typeof v === “undefined”) {
    // …
    }
    注意:
    js判断undefined类型
    if (reValue== undefined){
    alert(“undefined”);
    }
    发现判断不出来,最后查了下资料要用typeof
    方法:
    if (typeof(reValue) == “undefined”) {
    alert(“undefined”);
    }
    typeof 返回的是字符串,有六种可能:”number”、”string”、”boolean”、”object”、”function”、”undefined”