很奇怪的if判断问题
以下是我在javascript下,调用数据库里面的数据来判断的程序.
但是这个countrynb在数据库(数据库里字段也是数字)明明是存储46,再判断时却怎么也不输出 "usa ",都是输出 "china ",请问是哪里出问题了,谢谢.
<script language= "javascript ">
function init()
{
<%
sql= "select * from member where id=10 "
set rs=conn.execute (sql)
if not (rs.eof or err) then
%>
countrynb= " <%=rs( "countrynb ")%> ";
<%end if
if counrtynb=46 then%>
response.write= "usa "
<%else%>
response.write= "china "
<%end if%>
</script>
------解决方案--------------------if clng(counrtynb)=46 then
------解决方案--------------------服务器端使用客户端的变量,发梦发得太厉害了
------解决方案--------------------楼上的,至于吗
------解决方案--------------------response.write= "usa "
在客户端javascript里就是解析不过去的
javascrit里有这个语法吗?
改到 <% %> 里头去的话,asp有这个语法吗?
response.write =
.........
错的离谱了点
<script language= "javascript ">
function init()
{
<%
sql= "select * from member where id=10 "
set rs=conn.execute (sql)
if not (rs.eof or err) then
if rs( "countrynb ")=46 then
response.write "countrynb= " "usa " "; "
else
response.write "countrynb= " "china " "; "
end if
end if%>
</script>