<script type="text/javascript" language="javascript">
//验证码
function changeAuthCode() {
var num = new Date().getTime();
var rand = Math.round(Math.random() * 10000);
num = num + rand;
$('#ver_code').css('visibility','visible');
if ($("#vdimgck")[0]) {
$("#vdimgck")[0].src = "../include/vdimgck.php?tag=" + num;//这里写的域名地址如http://www.zzvips.com
}
return false;
}
</script>
3、在当前页添加JS代码,如下:
<script type="text/javascript" language="javascript">
//验证码
function changeAuthCode() {
var num = new Date().getTime();
var rand = Math.round(Math.random() * 10000);
num = num + rand;
$('#ver_code').css('visibility','visible');
if ($("#vdimgck")[0]) {
$("#vdimgck")[0].src = "../include/vdimgck.php?tag=" + num;//这里写的域名地址如http://www.zzvips.com
}
return false;
}
</script>