如何使用JQuery、主干和PHP将购物车数据插入MySQL数据库
我在这里找到了代码,但它没有提供插入数据库的功能如何使用JQuery、主干和PHP将购物车数据插入MySQL数据库,php,jquery,mysql,backbone.js,Php,Jquery,Mysql,Backbone.js,我在这里找到了代码,但它没有提供插入数据库的功能 下面是示例 index.html <script type="text/template" id="submit-btn-tmpl"> <button data-icon="arrow-d" data-theme="b" id="submit-btn">Submit</button> </script> 这不是一个jQuery移动问题。考虑一下这个问题。“SpRealAtCooDead我
下面是示例
index.html
<script type="text/template" id="submit-btn-tmpl">
<button data-icon="arrow-d" data-theme="b" id="submit-btn">Submit</button>
</script>
这不是一个jQuery移动问题。考虑一下这个问题。“SpRealAtCooDead我可能不是什么语言?它也使用JSON…标签必须读取jQuery、ReBoo.js、php、mysql:-)@ PrimoAtCooDeD非常感谢T.T.但是你知道如何解决我的问题吗?
// Submit Button
var SubmitButton = Backbone.View.extend({
el: '.basket-footer',
//get template
template: $('#submit-btn-tmpl').template(),
appRouter: null,
initialize: function() {
// set appRouter
this.appRouter = this.options.appRouter;
},
render : function () {
var totalPrice = 0
// get total price
if (this.appRouter.basketItems.length > 0)
totalPrice = this.appRouter.basketItems.totalPrice();
// clean up
$('#submit-btn').remove();
// and finally render this view with total price
$(this.el).append($.tmpl(this.template, {price:totalPrice}));
}
});