Home  >  Q&A  >  body text

Click I can’t see clearly. What’s the matter with the picture not being displayed after changing to another one?

<script>

function refreshVerify(){

var ts = Date.parse(new Date())/1000;

$("#verify_img").attr("src", "/captcha?id="+ts);

}

</script>



黄子乐黄子乐2435 days ago3207

reply all(8)I'll reply

  • 肆百禾

    肆百禾2018-03-21 22:42:39

    <script>
    function refreshVerify(){
    var str = Date.parse(new Date())/1000;
    $('#verify_img').attr("src", "/index.php/captcha?id="+str);
    }
    </script>

    After testing, this works

    Reply
    1
  • ???

    Indeed, thank you

    ??? · 2019-05-08 10:56:21
  • 鑫仔

    鑫仔2017-11-22 11:17:26

    Pay attention to the naming of verify and verity. The teacher used two names. Check to see if you have mistaken ty and fy.

    Reply
    1
  • 有趣儿

    The teacher is verity_img refreshVerity But according to the teacher's video operation, it does not refresh after clicking.

    有趣儿 · 2018-04-15 22:53:31
  • 轨迹

    轨迹2017-11-10 16:42:06

    This is how I wrote it

    var ts = Date.parse(new Date())/1000;

                                                                                                                                     {:captcha_src()}?id="+ts);//Refresh verification code


    Reply
    8
  • 这是个假世界

    why?

    这是个假世界 · 2018-03-25 10:29:48
  • 轨迹

    轨迹2017-11-10 16:41:31

    Open the console and see if it reports 404 The path is wrong,

    Reply
    0
  • 寻觅 beyond

    寻觅 beyond2017-11-09 13:10:19

    Go to the js community and ask

    Reply
    0
  • CancelReply