请教一个单引双引的问题

sarcs 2006-05-10 02:37:09
<input type="submit" name="Submit32" value="View" onClick="self.location.href='countryEntry.jsp?countrycode=nnn '">
要将nnn变成一个变量该怎么写??
...全文
63 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
WolfChaseLion 2006-05-11
  • 打赏
  • 举报
回复
应该是:
function link(){
var nnn = "xxx";
var url = "self.location.href='countryEntry.jsp?countrycode="+nnn;
}
onClick="link();"
WolfChaseLion 2006-05-11
  • 打赏
  • 举报
回复
var nnn = "xxx";
var url = "self.location.href='countryEntry.jsp?countrycode="+nnn;
onClick=url
adamcn 2006-05-10
  • 打赏
  • 举报
回复
<input type="submit" name="Submit32" value="View" onClick="self.location.href='countryEntry.jsp?countrycode=' + nnn">
sarcs 2006-05-10
  • 打赏
  • 举报
回复
又是你,谢谢
clare2003 2006-05-10
  • 打赏
  • 举报
回复
<script>
function f1()
{
self.location.href="countryEntry.jsp?countrycode='nnn'"
}
</script>
<input type="submit" name="Submit32" value="View" onClick='f1()'
ID=Submit1>

87,901

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧