Javascript code to update this kind of security code

Guys, I'm looking to refresh Captcha without refreshing the page, and there is no refresh button ... is there anyway I can do this work?

this is part of captcha in the HTML document, I cannot 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">
+4
source share
1 answer

The easiest way is to add some random or temporary parameter so that the browser has to make a new request, loading a new image. For instance:

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

This code will add a new GET parameter to the query string, similar to &_=1420922523150.

0
source

Source: https://habr.com/ru/post/1570725/


All Articles