js判断字符串是否为空

后台:request.setAttribute("Tishi", Tishi);
request.getRequestDispatcher("/WEB-INF/register.jsp").forward(request, response);

<%
String tishi=(String)request.getAttribute("Tishi");
%>
<script type="text/javascript">
$(document).ready(function(){
var ts = "<%=tishi%>";
if(ts!=null){
alert(ts);
}

});
</script>

不管怎么判断,js中弹出框都会执行,求大神指点

if(ts){
alert(ts);
}

温馨提示:答案为网友推荐,仅供参考

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网