Google에서 연구를 시도했지만 여기에서 몇 가지 질문을 통해 살펴 보았습니다. 솔루션 중 일부를 시도했지만 작동시키지 못합니다.jQuery 문제를 사용하여 보안 문자 새로 고침
<td>
<img id="captcha" src="captcha.php" name="captcha" />
<img src="refresh.jpg" width="25" alt="" id="refresh_captcha" name="refresh_captcha" />
<input type="text" name="txtCaptcha" id="txtCaptcha" size="10" />
</td>
아래의 코드는 작동하지 않습니다뿐만 아니라
$("#refresh_captcha").click(function() {
$("#captcha").attr("src","captcha.php?r=" + Math.random());
});
그리고이 :
$('.refresh_captcha').click(function(){
$('img').attr('src', 'captcha.php?cache=' + new Date().getTime());
});
가 나는 또한이 시도
jQuery(function($) {
jQuery('#captcha').after("<a href=\"#\" id=\"refresh_captcha\">Refresh<\/a>");
jQuery('body').delegate('#refresh_captcha','click',function(){
jQuery.ajax({
'success':function(html){
jQuery("#captcha").attr("src",html)
},
'url':'/captcha.php?refresh=1',
'cache':false
});
return false;
});
});
누구든지 나를 도울 수 ?
무엇이 문제입니까? "작동하지 않는"것은 무엇입니까? – corroded
가 작동하지 않습니다. captcha가 새로 고침되지 않음을 의미합니다. – user236501
'$ ('. refresh_captcha')'클래스 이름이 'refresh_captcha'인 요소가 없기 때문에''('. refresh_captcha ')''는 작동하지 않습니다. 당신이 클릭 할 때마다'r'의 값이 무작위로 나타나는 것을 보시겠습니까? – tradyblix