前端备忘
JS中判断字符换为空:
if(flag||username.trim()=="")
JS中判断日期是否为空:
if(birthday==null)
JS进行日期对象大小的比较
var birthday = document.getElementById("birthday").value; 页面传来的日期输入框的内容是字符串格式。
var flag = new Date()>new Date(birthday);
SpringJdbcTemplate中:
只有queryForObject()方法会抛出异常。
EL表达式中:
alert(typeof "${vc_error}") //String
alert(${vc_error}) //null 没有内容 不影响页面布局
alert(${vc_error==""}); //false
alert(${vc_error==null}); //true 没有找到时为null对象。
alert(${requestScope.vc_error==""}); //false
alert(${empty vc_error}) //true
在input标签中:
<input type="radio" name="gender" value="男" ${user.gender=="男"?'checked':''} />男
JS中使用EL表达式要加双引号。

浙公网安备 33010602011771号