为什么整个页面只在重新加载验证码时重新加载

时间:2017-05-12 09:50:42

标签: javascript html

function newcaptcha() {
  var c_currentTime = new Date();
  var c_miliseconds = c_currentTime.getTime();

  document.getElementById('captcha').src = 'captcha.php?' + Math.random();
}
<div class="group">
  <label for="everifyin" class="label">CAPTCHA</label>
  <input id="everifyin" type="text" name="everifysignin" placeholder="Enter the text">
  <button form="form2" onclick="newcaptcha()">Refresh</button>
  <img src="captcha.php" alt="CAPTCHA" id="captcha" align="right" />
</div>

单击刷新按钮,整页重新加载而不是仅使用casptcha代码

0 个答案:

没有答案
相关问题