The problem is that the code is missing a closing parenthesis for the .each() function. The code should be updated as follows:

$('#'+item_id).closest('.qcart_item').find('.qq_item_data').each(function() {
    if($(this).val()) {
        validate = true; 
    } else {
        validate = false;
        alert($(this).attr('data_alert')); 	
    }

    var data_slug =  $(this).attr('id');
    var data_value =  $(this).val();

    qq_order_item_single.push(data_slug+':'+data_value); 
});

var qresult = qq_order_item_single.toString();

This will fix the syntax error and ensure that the .each() function is properly closed

var validate = ; var qq_order_item_single = ;$qcart_itemeachfunction $#+item_idclosestqcart_itemfindqq_item_dataeachfunction if$thisval validate = true; else validate = false;alert$thisattrdata_alert

原文地址: https://www.cveoy.top/t/topic/ivDg 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录