我得到Uncaught TypeError: $(...).button is not a function增加产品时,这个错误。我调试了它,您可以在 root 上看到按钮,但仍然可以看到。实际上,这个 opencart 2.1 功能,除了一个页面之外,它在其他所有页面上都可以正常工作。所以任何人都可以请指导我解决方案。
<input type="button" class="letTry" value="thisOne" />
$('.letTry').on('click',function(){
cart.add(51,3);
});
Run Code Online (Sandbox Code Playgroud)
var cart = {
'add': function(product_id, quantity) {
$.ajax({
url: 'index.php?route=checkout/cart/add',
type: 'post',
data: 'product_id=' + product_id + '&quantity=' + (typeof(quantity) != 'undefined' ? quantity : 1),
dataType: 'json',
beforeSend: function() {
$('#cart > button').button('loading');
},
complete: function() {
$('#cart > button').button('reset');
},
success: function(json) {
//alert('TestUpdateTEST');
$('.alert, .text-danger').remove();
if (json['redirect']) {
location = json['redirect'];
}
if …Run Code Online (Sandbox Code Playgroud) 我想在我的表列中保存字符串"thats'one",但我不想使用mysqli_real_escape_string.任何人都可以指导我如何做到这一点?