插入js效果但是不出效果,小弟我用{$user_name}判断的,是不能混着用么?

WBOY
Release: 2016-06-13 12:03:17
Original
800 people have browsed it

插入js效果但是不出效果,我用{$user_name}判断的,是不能混着用么??
登录人为:{$user_name}
<script></script>
<script><br />$(document).ready(function(){<br /> if({$user_name} !=null)<br /> {$("#login_null").hide();}<br /> }<br />});<br /></script>

去掉if  效果就出来了 但是加上判断就不行。。上面我也打印了判断条件,也显示了 ,但是不能判断是因为神马
------解决方案--------------------
if({$user_name} !=null) 是错误的!变量未定义
if("{$user_name}" !=null) 要用引号括起来!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!