请教我的代码中的问题 ajax+php(CodeIgniter)
我用ajax将页面的值传递到后台,但是却无法获取,请教下我这个该怎么写呢?麻烦大牛们了。
我的页面代码为:
<script type=”text/javascript”>
$(function() {
$(“form[name=’estimate’]”).submit(function(e) {
e.preventDefault();
var btn = $(“form[name=’estimate’]”).find(“input[type=’submit’]”),
price = $(this).find(“.price”);
btn.button(‘loading’);
price.html(“”);
$.ajax({
type: “POST”,
url: ‘<?php echo base_url(); ?>index.php?module=testprice&view=getprice’,
data: $(this).serializeArray(),
success: function(data) {
price.html(“
$” + data + ” RMB
” + “
“);
btn.button(‘reset’);
},
搞gaodaima代码
error: function() {
alert(“Service Unavailable”);
}
});
});
</script>