0
我想用jQuery做一個相當簡單的$ .post()。我有一個帶有輸入的典型表單,最後帶有一個ID爲#subBuy的按鈕。jQuery Ajax POST不通過
這裏是我的jQuery:
$('#subBuy').live('click',function() {
$.post('php/buyCoup.php', $('#buyCoup').serialize(), function(){
$('#buyCoup').hide();
$('#success').show();
});
});
當我按一下按鈕,就應該發佈使用Ajax和表演形式/隱藏在成功的某些元素。
我知道HTML很好,因爲之前沒有提交過jQuery的表單。
這裏是buyCoup.php:
<?php
session_start();
$con = mysql_connect("localhost","foo","bar");
mysql_select_db("coupons", $con);
$retailerName = $_REQUEST["retailerName"];
$intDeal = $_REQUEST["intDeal"];
$coupTerms = $_REQUEST["coupTerms"];
$datePicker = $_REQUEST["datepicker"];
mysql_query("correctly functioning query to insert the data");
?>
任何幫助嗎?
除了安全漏洞,有這麼多可以去錯在這裏。你用螢火蟲來檢查迴應嗎? – JamesHalsall 2011-03-09 16:21:15