JS array random string (ad does not repeat) _javascript tips

Source: Internet
Author: User

The better place is the operation of the JS array, not duplicate array ID display, perfect implementation.

<textarea id="runcode31344"><script language= "JavaScript" type= "Text/javascript" > Theads=new Array (); Shu = 13; Dot= '; theads[1]= ' cloud-dwelling community first '; theads[2]= ' cloud-dwelling Community II '; theads[3]= ' cloud-dwelling community third '; theads[4]= ' cloud-dwelling community fourth '; theads[5]= ' cloud-dwelling community fifth '; theads[6]= ' cloud-dwelling community sixth '; theads[7]= ' cloud-dwelling community seventh '; theads[8]= ' cloud-dwelling community eighth '; theads[9]= ' cloud-dwelling community nineth '; theads[10]= ' cloud-dwelling community tenth '; theads[11]= ' cloud-dwelling community 11th '; theads[12]= ' cloud-dwelling community 12th '; theads[13]= ' cloud-dwelling community 13th '; adshu=shu+1 function QuickPick () {var ball for (ball = 1; ball < Adshu; ball++) {This[ball] = parseint (Math.ran Dom () * shu + 1); for (var list = 0; List < ball list++) {if (this[list] = = This[ball]) {list = ball; ball--; }} return this; } var idx; var ballball = new Array (SHU); Ballball = this. QuickPick (); for (idx = 1; idx < Adshu; idx++) {document.write (dot+theads[ballball[idx]]+ ' <br> '); if (idx < shu) {document.write (')}}//document.write (DOT+THEADS2); </script></textarea>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.