Home  >  Article  >  Web Front-end  >  JavaScript micro-signal random switching code implementation code

JavaScript micro-signal random switching code implementation code

小云云
小云云Original
2018-03-12 09:12:302126browse

Regarding how to implement random switching of WeChat ID in js, this article mainly shares with you the code implementation code of JavaScript WeChat ID random switching, which is divided into js and html parts. I hope it can help everyone.

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>

Related recommendations:

10 recommended courses about WeChat ID

The above is the detailed content of JavaScript micro-signal random switching code implementation code. 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