php jquery Ajax 提交、读取 json

<mce:script type="text/javascript" language="javascript"><!-- function del(com_id,meet_id){ $.ajax({ url:'../company/meet.Ajax.php', type:'POST', data:{com_id:com_id,meet_id:meet_id}, dataType:"json", timeout: 1000, error: function(){ alert('Sorry, the server is busy now, please try again later.'); }, success: function(data){ if(data){ $("#row_"+data.meet_id).remove(); if($("#meeting_info").find("tr").length==1){ var tds = $("#meeting_info>tbody>tr:last").find("td").length; $("#meeting_info>tbody").append('<tr id ="no_meet" <?=linecolor_v2(1)?> height="22" align="left"><td colspan="'+tds+'"><b>there is no meet now.</b></td></tr>'); } } else { alert("sorry, delete fail, please try again later."); } } }); } if($("#meeting_info").find("tr").length==1){ var tds = $("#meeting_info>tbody>tr:last").find("td").length; $("#meeting_info>tbody").append('<tr id ="no_meet" <?=linecolor_v2(1)?> height="22" align="left"><td colspan="'+tds+'"><b>there is no meet now.</b></td></tr>'); } // --></mce:script>

 

<? $retval = '{"status":"fail"}'; if($_REQUEST['meet_id'] && $_REQUEST['com_id']) { include_once("../include/function.php"); include_once("../include/dbconnect.php"); global $connectionid,$SITE_PARAS, $AGENT_INFO; //data:{com_id:com_id,meet_id:meet_id} $sql = "DELETE FROM RDL.MEETING WHERE MEET_PID = TO_NUMBER('".$_REQUEST['meet_id']."') AND COM_PID = TO_NUMBER('".$_REQUEST['com_id']."')"; $result = sql_exec($connectionid, $sql, false); //print the error message supplied by database //echo $LAST_OCI_ERROR; if(sql_error($result)) { print_r($LAST_OCI_ERROR); exit; } //echo '{"status":"success"}'; //{"status":"success"} $retval = '{"status":"success","meet_id":"'.$_REQUEST['meet_id'].'","com_id":"'.$_REQUEST['com_id'].'"}'; //{"status":"success","meet_id":"559683","com_id":"507863"} } echo $retval; ?>

你可能感兴趣的:(php jquery Ajax 提交、读取 json)