jQuery错误。未捕获的TypeError:jQuery(...)。selected不是一个函数

时间:2015-04-23 23:45:34

标签: javascript jquery html wordpress

我的JavaScript中有一个我试图解决的错误。

我的Chrome说:Uncaught TypeError: jQuery(...).chosen is not a function

jQuery(document).ready(function () {
  jQuery('select.scan_action').chosen();
  jQuery('#barcode-scan-form input#scan-code').focus(function () {
    jQuery(this).select()
  });
  jQuery('#barcode-scan-form input#scan-code').scannerDetection(function () {
    jQuery('#barcode-scan-form form').submit()
  });
  jQuery('#barcode-scan-form form').submit(function (e) {
    e.preventDefault();
    jQuery('#barcode-scan-loader').show();
    jQuery('#barcode-scan-result').html('');
    var t = jQuery('#barcode-scan-form input#scan-code').val(),
    n = jQuery('#barcode-scan-form #scan-action').val();
    jQuery.post(wc_order_barcodes.ajaxurl, {
      action: 'scan_barcode',
      barcode_input: t,
      scan_action: n,
      woocommerce_order_barcodes_scan_nonce: wc_order_barcodes.scan_nonce
    }).done(function (e) {
      jQuery('#barcode-scan-form input#scan-code').focus();
      if (!e) return;
      jQuery('#barcode-scan-loader').hide();
      jQuery('#barcode-scan-result').html(e)
    })
  })
});

我该如何解决这个问题?

0 个答案:

没有答案