我在某处遇到语法问题但由于我不是javascript开发人员而无法发现它。有眼睛好的人可以指出问题吗?
$.ajax(
{
type: 'GET',
url: / + 'modules/blocklayered/blocklayered-ajax-back.php',
未捕获的SyntaxError:意外的标记ILLEGAL
data: (all ? '' : $('input[name="categoryBox[]"]').serialize()+'&')+(id_layered_filter ? 'id_layered_filter='+parseInt(id_layered_filter)+'' : ''),
success: function(result) {
答案 0 :(得分:2)
语法错误就在这一行......
url: / + 'modules/blocklayered/blocklayered-ajax-back.php',
/
放错了位置,应该是......
url: '/modules/blocklayered/blocklayered-ajax-back.php',
答案 1 :(得分:1)
您的url:
参数中有拼写错误:
$.ajax({
type: 'GET',
url: / + 'modules/blocklayered/blocklayered-ajax-back.php',
// ^^ here
data: (all ? '' : $('input[name="categoryBox[]"]').serialize()+'&')+(id_layered_filter ? 'id_layered_filter='+parseInt(id_layered_filter)+'' : ''),
success: function(result) {
正确的代码应该是:
$.ajax({
type: 'GET',
url: '/modules/blocklayered/blocklayered-ajax-back.php',
data: (all ? '' : $('input[name="categoryBox[]"]').serialize()+'&')+(id_layered_filter ? 'id_layered_filter='+parseInt(id_layered_filter)+'' : ''),
success: function(result) {