先看代码:
1 $(".verify_img").click(function(){
2 var timenow = new Date().getTime();
3 var url ="{:U('index/loginverify')}&t="+timenow;
4 alert(url);
5 $(this).attr("src",url)
6 });
以上代码导致验证码点击切换导致验证码图片无法显示。
再看下面代码:
$(".reloadverify").click(function(){
var timenow = new Date().getTime();
var url ="{:U('index/loginVerify')}?t="+timenow;
$("#image_d").attr("src",url)
});
以上代码的区域是?和&的区别。对比之后就可以看出问题就处在哪儿。还有在问号后面直接跟上一个随机数也是有效的。var url ="{:U('index/loginVerify')}?"+Math.random();
写道这里问题就已经很清楚了。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

WebStorm Mac version
Useful JavaScript development tools

Dreamweaver Mac version
Visual web development tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Zend Studio 13.0.1
Powerful PHP integrated development environment