试试<script>
function dogo(){
var urls = new Array();
n = Math.floor(Math.random()*1899);
urls[n] = "http://pps.studenthere.com/movie_db.php?id="+n
location.href= urls[n]
}
</script><input value="看一下部電影" name="button" onclick="dogo()" type="button"/>
function dogo(){
var urls = new Array();
n = Math.floor(Math.random()*1899);
urls[n] = "http://pps.studenthere.com/movie_db.php?id="+n
location.href= urls[n]
}
</script><input value="看一下部電影" name="button" onclick="dogo()" type="button"/>
<script>
function dogo(){
location.href= "http://pps.studenthere.com/movie_db.php?id="+Math.floor(Math.random()*1899)
}
</script> 这样不就行了...