• Resolved Jan

    (@krugmedien)


    Hi,
    your plugin does not seem to work in Internet Explorer 11 (IE11).
    This error breaks the code:
    SCRIPT1006: ‘)’ expected frontend.js (126,36)

    This is the code (first line throws the error):

    function wooco_init($wrap, context = null) {
        var wrap_id = $wrap.attr('data-id');
        var container = wooco_container(wrap_id);
        var $container = $wrap.closest(container);
    
        wooco_check_ready($container);
        wooco_calc_price($container);
        wooco_save_ids($container);
    
        if (context === null || context === 'on_select' || context === wooco_vars.show_alert) {
            wooco_show_alert($container);
        }
    }

    I fixed the problem by changing the code to this:

    function wooco_init($wrap) {
        var wrap_id = $wrap.attr('data-id');
        var container = wooco_container(wrap_id);
        var $container = $wrap.closest(container);
    
        wooco_check_ready($container);
        wooco_calc_price($container);
        wooco_save_ids($container);
    }

    Are you aware of this error?
    Do you have a better solution?

    Thanks for your time. 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author WPClever

    (@wpclever)

    Hi @krugmedien ,

    Thanks for contacting us here. Unfortunately, our plugin doesn’t support the IE browser anymore since this browser is soon to be killed by its developers. This browser is also too old and full of issues.

    Best regards.

    Thread Starter Jan

    (@krugmedien)

    Hi WPClever,
    thanks for your feedback!

    The following lines seem to work in any browser.
    If someone stumbles across the same error then this is probably a better solution:

    # /wp-content/plugins/wpc-composite-products-premium/assets/js/frontend.js
    function wooco_init($wrap, context) {
    
        if ( typeof context === 'undefined' ) {
            var context = null;
        }
    
        var wrap_id = $wrap.attr('data-id');
        var container = wooco_container(wrap_id);
        var $container = $wrap.closest(container);
    
        wooco_check_ready($container);
        wooco_calc_price($container);
        wooco_save_ids($container);
    
        if (context === null || context === 'on_select' || context === wooco_vars.show_alert) {
            wooco_show_alert($container);
        }
    
    }
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘JS Error in Internet Explorer 11 SCRIPT1006: ‘)’ expected’ is closed to new replies.