이것은 내 자바 스크립트입니다. 데이터베이스에 추가 할 때 레코드를 표시하고 새 레코드를 표시하려고합니다.자바 스크립트 결과를 표시 할 때
showrecords(); 데이터베이스에 레코드를 표시합니다. 여기서 abouts는 올바르게 작동하는 코드에 넣을 수 있습니다.
$(document).ready(function()
{
//showrecords()
function showrecords()
{
$.ajax({
type: "POST",
url: "demo_show.php",
cache: false,
success: function(html){
$("#display").after(html);
document.getElementById('content').value='';
$("#flash").hide();
}
});
}
$(".comment_button").click(function() {
var element = $(this);
var test = $("#content").val();
var dataString = 'content='+ test;
if(test=='')
{
alert("Please Enter Some Text");
}
else
{
$("#flash").show();
$("#flash").fadeIn(400)
.html('<img src="http://tiggin.com/ajax-loader.gif" align="absmiddle"> <span class="loading">Loading Comment...</span>');
$.ajax({
type: "POST",
url: "demo_insert.php",
data: dataString,
cache: false,
success: function(html){
// $("#display").after(html);
document.getElementById('content').value='';
$("#flash").hide();
//Function for showing records
//showrecords();
}
});
}
return false;
});
});
코드 분할 경로는 어디에 있습니까? 이것은 다소 모호합니다 ... –