Controller passes a null to ajax.

success : function(data) {
                /* alert(data);
                alert(typeof data); */
                
                 if(!data){
                 alert("");
                 return false;
                 } else {
                 alert(typeof data); 
                 alert("");
                 return false;
                 } 
            }

how to judge the if when null, is sent back to the background. If it is a blank prompt box
the prompt box will only pop up if the value is returned now, and there will be no prompt box when it comes back to null

.
Sep.06,2021

now the console confirms whether it is the string null or null type

var flag = true;
var student_id = $('input[name="student_id"]').val();//input
            //alert(student_id);
            $.ajaxSetup({
                  async: false//
                  });
            $.post("<%=basePath%>user/queryByID", {student_id : student_id},function(data){
                //alert(data);
                if (!data) {//
                    alert("");
                    flag = false;
                    //alert(flag);
                }
            });
        //alert("======"+flag);
        return flag;
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b8bf-34651.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b8bf-34651.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?