如何解决控制台中的JSON.parse(json)错误? Ajax代码

The error is:

   jQuery('#select_manufacturer').on('change', function() { // occurs when the value of an element has been changed
    var manufacturer = $(this).val();
    $('#models_select').html('<option>Select Model:</option>');
    $.ajax({
      url: '<?php echo get_bloginfo("template_url"); ?>/get_models_manufacturer.php',
      type: 'POST',
        data: 'manufacturer=' + manufacturer,
      success: function(json) {
        var models = JSON.parse(json); //data becomes a JavaScript object
            for(var i = 0; i < models.length; i++) {
                $('#models_select').append('<option value="' + models[i].bModel + ' ">' + models[i].bModel + '</option>')
            }
      }
    });
});

错误来自var models = JSON.parse(json);我该如何解决?

评论