下列JS代码如何从数据库里取内容
<!DOCTYPEhtml><html><head><metacharset="UTF-8"><title>Document</title></head><body><p...
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<p id="say"></p>
<p id="s"></p>
<script type="text/javascript">
window.onload=function(){
var says=['明日复明日明日何其多','我生待明日万事成蹉跎','少壮不努力,老大徒伤悲','宝剑锋从磨砺出,梅花香自苦寒来','吃得苦中苦,方为人上人'];
var says2=['明日复明日明日何其多','我生待明日万事成蹉跎','少壮不努力,老大徒伤悲','宝剑锋从磨砺出,梅花香自苦寒来','吃得苦中苦,方为人上人'];
var timer=null;
var say=document.getElementById('say');
var say2=document.getElementById('s');
var ran=Math.floor(Math.random()*says.length);
say.innerHTML=says[ran];
var ran2=Math.floor(Math.random()*says2.length);
say2.innerHTML=says2[ran2];
}
</script>
</body>
</html> 展开
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<p id="say"></p>
<p id="s"></p>
<script type="text/javascript">
window.onload=function(){
var says=['明日复明日明日何其多','我生待明日万事成蹉跎','少壮不努力,老大徒伤悲','宝剑锋从磨砺出,梅花香自苦寒来','吃得苦中苦,方为人上人'];
var says2=['明日复明日明日何其多','我生待明日万事成蹉跎','少壮不努力,老大徒伤悲','宝剑锋从磨砺出,梅花香自苦寒来','吃得苦中苦,方为人上人'];
var timer=null;
var say=document.getElementById('say');
var say2=document.getElementById('s');
var ran=Math.floor(Math.random()*says.length);
say.innerHTML=says[ran];
var ran2=Math.floor(Math.random()*says2.length);
say2.innerHTML=says2[ran2];
}
</script>
</body>
</html> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询