在按钮上单击。代码假定提交内容并显示内容。无法找出我要去哪里。
var currentDate = new Date()
var day = currentDate.getDate()
var month = currentDate.getMonth() + 1
var year = currentDate.getFullYear()
document.getElementById('date').innerHTML =("<b>" + day + "/" + month + "/" + year + "</b>");
$(document).ready(function(){
$('#btn_submit').click(function(){
var descriptionO =$('#descriptionO').val();
var PurchaseO = $('#PurchaseO').val;
var total = $('#total');
var notes = $('#notes');
$.post('ajaxjs.php'),{postdescriptionO:descriptionO,postPurchaseO:PurchaseO,posttotal:total,postnotes:notes},
$.ajax({
type:'Post',
url: 'index.php',
data: $(this).serialize(),
cache: false,
success: function(result){
$("display").html(result);
$descriptionO=$_POST['descriptionO'];
$PurchaseO=$_POST['PurchaseO'];
$total=$_POST['total'];
$notes=$_POST['notes'];
当我单击按钮时,什么也没有发生。我已经检查过页面,并且没有抛出任何错误。单击按钮时,我想接收显示在同一页面上的内容。我是初学者