add captcha reload script
This commit is contained in:
parent
af59a38a40
commit
920ddb64b3
20
contrib/js/captcha-reload.js
Normal file
20
contrib/js/captcha-reload.js
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
function setSrcQuery(e, q) {
|
||||||
|
var src = e.src;
|
||||||
|
var p = src.indexOf('?');
|
||||||
|
if (p >= 0) {
|
||||||
|
src = src.substr(0, p);
|
||||||
|
}
|
||||||
|
e.src = src + "?" + q
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function reload(el) {
|
||||||
|
setSrcQuery(el, "reload=" + (new Date()).getTime());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
onready(function(){
|
||||||
|
document.getElementById("captcha_img").onclick = function() {
|
||||||
|
reload(document.getElementById("captcha_img"));
|
||||||
|
};
|
||||||
|
});
|
Reference in New Issue
Block a user