:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js{API removed}"></script>
<script type="text/javascript">
$(document).ready(function() {
alert('test');
if ($('#profile_visible:checked').val() !== null) {
$.ajax({
url: 'inc/profileVisible.php',
success: function(data) {
$('#resultProfileVisible').innerhtml="success";
alert('Load was performed.');
}
});
}
}
</script>
... 그리고 문서의 본문에. on
과 결합 이벤트 핸들러 (jQuery를> 1.7) 또는 bind
(jQuery를 < 1.7) 또는 jQuery의 각종 단축키 방법 (같은 .change
또는 .click
) 또한
$(document).ready(function() {
$("#profile_visible").change(function() {
if (this.checked) {
$.ajax({
url: 'inc/profileVisible.php',
success: function(data) {
$('#resultProfileVisible').html("success");
alert('Load was performed.');
}
});
}
});
});
는 요소의 HTML 콘텐츠 때를 설정하는 대신 .innerHtml
의 .html()
를 사용 jQuery 객체 사용.
예 :http://jsfiddle.net/andrewwhitaker/8x6h8/1/
어떤 청취자가 추천 해 주나요? 나는 오직 하나만 볼 수 있습니다 - 준비된 문서. 그것이 당신이 의미하는 것입니까? –