菜鸟求助~~~ JAVA随即内容调用

littlezhouy 2012-07-28 12:42:16
这是原来的代码。。

<html>
<head>
<title>随机'文字</title>
</head>
<body>
<script language="JavaScript">
<!-- Hide
var a = Math.random() + ""
var rand1 = a.charAt(5)
quotes = new Array
quotes[1] = '文字一'
quotes[2] = '文字二'
quotes[3] = '文字三'
quotes[4] = '文字四'
quotes[5] = '文字五'
quotes[6] = '文字六'
quotes[7] = '文字七'
quotes[8] = '文字八'
quotes[9] = '文字九'
quotes[0] = '文字十'
var quote = quotes[rand1]
//-->
</script>
<script language="JavaScript">
<!-- Hide
document.write( quote )
//-->
</script>
</body>
</html>

应该如何改才能给“文字X”加入超链接呢?谢谢了!~~
...全文
54 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
AMinfo 2012-07-28
  • 打赏
  • 举报
回复
<html>
<head>
<title>随机'文字</title>
</head>
<body>
<script language="JavaScript">
<!-- Hide
var a = Math.random() + ""
var rand1 = a.charAt(5)
quotes = new Array
quotes[1] = '文字一'
quotes[2] = '文字二'
quotes[3] = '文字三'
quotes[4] = '文字四'
quotes[5] = '文字五'
quotes[6] = '文字六'
quotes[7] = '文字七'
quotes[8] = '文字八'
quotes[9] = '文字九'
quotes[0] = '文字十'
var quote = "<a href='" + quotes[rand1] + "'>" + quotes[rand1] + "</a>";
//-->
</script>
<script language="JavaScript">
<!-- Hide
document.write( quote )
//-->
</script>
</body>
</html>

50,530

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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