xhr 요청으로 일부 정보를 출력합니다. 이 출력에는 버튼이 있습니다. 필자는 함수 (전자 메일 보내기)를 바인딩하려고하지만 어떤 이유로 그럴 수 없습니다.jQuery - xhr 출력 내의 버튼에 함수 바인딩
분명히 jQuery가 포함되어 있으며 콘솔에서 오류가 발생하지 않습니다. 이미 몇 가지 옵션을 시도했습니다!
버튼 HTML :
$(document).ready(function(){
$('#sendraportemail').click(function(){
var uroemail = $('#uroemail').val();
console.log(uroemail);
});
});
(function() {
$('#sendraportemail').click(function(){
var uroemail = $('#uroemail').val();
console.log(uroemail);
});
});
$('.sendraportemail').click(function(){
var uroemail = $('#uroemail').val();
console.log(uroemail);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<button type="button" class="btn btn-primary sendraportemail" id="sendraportemail">SEND E-MAIL</button>
내가 $로 바인딩 시도 ('#의 sendraportemail') 또는 $ ('sendraportemail.'). 내가 뭘 잘못 했니? 도움이 매우 감사.
$은 (documen) .ready() ... 올바른 일이 ... 필요는이 내가 시도 옵션입니다 나머지 2 –
은하지 않았다가 없습니다 그들 모두는 같은 시간에 3 명입니다. 그리고이 중 어느 것도 맞지 않습니다. 답변을 참조하십시오. – Nita