のjQueryコードを提出jQueryの問題を通してボタン
$('#cartSubmit').click(function() {
var product_name = encodeURIComponent($('#product_name').val());
var barcode = encodeURIComponent($('#barcode').val());
var Quantity = encodeURIComponent($('#Quantity').val());
var postData = "product_name="+product_name+"&barcode="+barcode+"&Quantity"+Quantity;
$.ajax
({
type: 'POST',
url: 'http://localhost/example/index.php/cart/cartoutput',
data: postData,
success: function(html) {
//alert(html);
$('#cartDisplay').html(html);
}
});
return false;
});
VIEWコード
<tr><td align="center" > <input type="submit" value="SUBMIT" id="cartSubmit"/></td> </tr>
私は出力を表示することはできませんよ。コード内の問題は何ですか?
を行っていますメソッドをjqueryからhttp://api.jquery.com/jQuery.post '$ .post(" test.php "、$("#testform ")。serialize());' – Kumar
あなたにch火かぶりに何か間違いがあった? – Rafay
firebugのようなエラーはありません – user855492