怎样用js刷新验证码页面(php做的)解决方法

WBOY
Release: 2016-06-13 13:41:18
Original
984 people have browsed it

怎样用js刷新验证码页面(php做的)
我是想在登录页面的点击【看不清】将随机码刷新:  怎样用js刷新验证码页面(php做的)解决方法 看不清  
其中checkcode.php是随机码页面。只是刷新这个check.php,而不是整个index.php都刷新


------解决方案--------------------

HTML code

<img  id="code" src="checkcode.php" alt=" 怎样用js刷新验证码页面(php做的)解决方法 " >

<a href="javascript:;" onclick="refreshCode()">看不清</a>   

<script>
var src= document.getElementById('code').src;
function refreshCode(){
    
    document.getElementById('code').src=src+"?code=" + Math.random(); 
}
</script> <div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template