SyntaxError: expected expression, got '<'
Por ejemplo me lo da en este código
Código:
Me estoy dando cuenta que al verlo, en las lineas que me da el error, me añade automaticamente un <p> o un </p><script> jQuery(document).ready(function($) { var fields_in_categories = new Array(); <?php foreach ($content_fields AS $content_field): if (!$content_field->is_core_field) if (!$content_field->isCategories() || $content_field->categories === array()) { ?> fields_in_categories[<?php echo $content_field->id?>] = []; <?php } else { ?> fields_in_categories[<?php echo $content_field->id?>] = [<?php echo implode(',', $content_field->categories); ?>]; <?php } ?> <?php endforeach; ?> hideShowFields(); $("input[name=tax_input\\[w2dc-category\\]\\[\\]]").change(function() {hideShowFields()}); $("#w2dc-category-pop input[type=checkbox]").change(function() {hideShowFields()}); function hideShowFields() { var selected_categories_ids = []; $.each($("input[name=tax_input\\[w2dc-category\\]\\[\\]]:checked"), function() { selected_categories_ids.push($(this).val()); }) $(".w2dc-field-input-block").hide(); $.each(fields_in_categories, function(index, value) { var show_field = false; if (value != undefined) { if (value.length > 0) for (key in value) for (key2 in selected_categories_ids) if (value[key] == selected_categories_ids[key2]) show_field = true; if ((value.length == 0 || show_field) && $(".w2dc-field-input-block-"+index).length) $(".w2dc-field-input-block-"+index).show(); } }); } }); </script>
Alguien sabe a que puede deberse?
Gracias