我想显示一个包含我制作的随机代码的对话框。这是我的功能:
function randomString() {
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
var string_length = 8;
var randomstring = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substring(rnum, rnum + 1);
}
alert(randomstring);
window.location = "Insert-Transac.jsp";
}
我想显示变量randomstring
一段时间并隐藏它。谁能帮我?