Javascript代码刷新这种Captcha [英] Javascript Code To Refresh This Kind Of Captcha

查看:99
本文介绍了Javascript代码刷新这种Captcha的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是HTML文档中的验证码部分,我无法找到类节。

 < img class =captcha border =0src =https://www.gametwist.com/web/Captcha-Image/?
bc = 000000& fc = 188eae& h = 58& w = 258& fill = ffffffalt =验证码图像>


解决方案

最简单的方法是添加一些随机或时间戳参数所以浏览器不得不提出新的请求,下载新的图像。例如:

  document.querySelector('。captcha')。src + ='& _ ='+ Date.now (); 

这段代码会将新的GET参数附加到查询字符串,类似于& _ = 1420922523150


Guys i am looking for refreshing Captcha without refresh the page , and there is no refresh button ... is there anyway i can make this work out ?

this is the captcha part in the HTML document , i could'nt find the class section .

     <img class="captcha" border="0" src="https://www.gametwist.com/web/Captcha-Image/? 
     bc=000000&fc=188eae&h=58&w=258&fill=ffffff" alt="captcha image">

解决方案

The simplest way would be adding some random or timestamp parameter so that browser had to make new request, downloading new image. For example:

document.querySelector('.captcha').src += '&_=' + Date.now();

This code will append new GET parameter to query string similar to &_=1420922523150.

这篇关于Javascript代码刷新这种Captcha的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆