曾军的博客
记录我互联网产品的全新旅程
当前位置: 主页 > 代码收藏 >
16
2006-04
文字后面加随机字符
作者:admin | 浏览:

很好的代码
做站时很有用

  1. <script language="VBScript"> 
  2. Function addCopy(num)  
  3. Dim ranValue, i, resultChr  
  4. resultChr = "" 
  5. for i = 1 to num  
  6. Randomize  
  7. ranValue = (9 - 0) * rnd * 10  
  8. resultChrresultChr = resultChr & Chr(ranValue)  
  9. Next  
  10. addCopy = "<font color='#FF0000'>© this code writen by 帅青蛙,   " & resultChr & " </font>"  
  11. End Function  
  12.  
  13. Function replaceBR(fstring)  
  14. If fstring = "" Or IsNull(fstring) Then  
  15.   replaceBR = "" 
  16. Else  
  17.   //replaceBRreplaceBR = replaceBR & replace(fstring, chr(10), "<br>" & addCopy(3))  
  18.   replaceBRreplaceBR = replaceBR & fstring & "<br>" & addCopy(3)  
  19. End If  
  20. End Function  
  21.  
  22. for i = 1 to 3  
  23. document.write replaceBR("This code writen by 帅青蛙, you can use it free, but please keep this copyright!")  
  24. document.write ("<br>")  
  25. next  
  26. </script> 
Tags:文字 随机 字符 
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
验证码:点击我更换图片