亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

javascript生成隨機(jī)大小寫字母的方法

 更新時(shí)間:2014年02月20日 16:36:01   作者:  
這篇文章主要介紹了javascript生成隨機(jī)大小寫字母的方法,需要的朋友可以參考下
復(fù)制代碼 代碼如下:

/**
* 返回一個(gè)隨機(jī)的小寫字母
*/
function getLowerCharacter(){
return getCharacter("lower");;
}


/**
* 返回一個(gè)隨機(jī)的大寫字母
*/
function getUpperCharacter(){
return getCharacter("upper");;
}


/**
* 返回一個(gè)字母
*/
function getCharacter(flag){
var character = "";
if(flag === "lower"){
character = String.fromCharCode(Math.floor( Math.random() * 26) + "a".charCodeAt(0));
}
if(flag === "upper"){
character = String.fromCharCode(Math.floor( Math.random() * 26) + "A".charCodeAt(0));
}
return character;
}

相關(guān)文章

最新評(píng)論