JavaScript类型转换的问题

sequanyining sequanyining 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
<script type="text/javascript">
function a(count)
{
(count).toString();
alert(typeof(count));
this.location.href = "editServlet?count"=count;
this.forms[0].submit();
}
</script>


<!--页面-->
<td width="100" class="hh" align="center" height="22">
<input type="text" name="count" size="5" value="<%=item.getCount()%>" onblur="a(<%=item.getCount()%>)"/>
</td>

传递过来的count在java里是整形,alert(typeof(count))后,输出地是“number”类型,然后报错 : 不能给 '[string]' 赋值,也就是number转String没成功,请问应该怎么把整形给转成String呢?还是我别的地方写错了,大家帮我看看,谢谢了
...全文

相关推荐

评论 10
收藏 已收藏
分享
返回顶部
sequanyining
JavaScript 87,983 成员 224,680 内容