小编adn*_*lid的帖子

未捕获的类型错误:$(...).button 不是函数

我得到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)

JS函数

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)

javascript jquery

0
推荐指数
1
解决办法
1万
查看次数

在没有mysqli_real_escape_string的数据库中使用单引号保存字符串

我想在我的表列中保存字符串"thats'one",但我不想使用mysqli_real_escape_string.任何人都可以指导我如何做到这一点?

php mysql string mysqli

0
推荐指数
1
解决办法
568
查看次数

标签 统计

javascript ×1

jquery ×1

mysql ×1

mysqli ×1

php ×1

string ×1