Home >Web Front-end >JS Tutorial >How to implement random switching code of WeChat ID through JavaScript (detailed tutorial)

How to implement random switching code of WeChat ID through JavaScript (detailed tutorial)

亚连
亚连Original
2018-05-31 15:32:422804browse

This article mainly introduces JavaScript to implement random switching of WeChat ID. Friends who need it can refer to

js to implement random switching of WeChat ID. The code is divided into js and html parts. Please refer to

js code:

arr_wx =new Array("aaaa","bbbb","cccc"); 
  var wx_index = Math.floor((Math.random() * arr_wx.length)); 
  var stxlwx = arr_wx[wx_index]; 
  var img = "<?php echo $pctem[&#39;pathurl&#39;] ?>"+arr_wx[wx_index]+".jpg"

html code:

<script>document.write(stxlwx)</script>

The above is what I compiled for everyone. I hope it will be helpful to everyone in the future. .

Related articles:

Detailed tutorial on using Angular CLI to generate Angular 5 projects

##jquery implements the dragging file upload loading progress bar function

Analysis of javascript prototype and prototype chain

The above is the detailed content of How to implement random switching code of WeChat ID through JavaScript (detailed tutorial). For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn