Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/392.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 未捕获的语法错误:意外标记:_Javascript_Php_Ajax - Fatal编程技术网

Javascript 未捕获的语法错误:意外标记:

Javascript 未捕获的语法错误:意外标记:,javascript,php,ajax,Javascript,Php,Ajax,我有一个意外的标记: 但我不知道这是为什么 发生这种情况的代码 <script type="text/javascript"> $('.delete-btn').click(function() { $.ajax(function() { type: 'POST', url: 'ajax.php', data: { filename: filename }, success: function(return) { if(return

我有一个意外的标记: 但我不知道这是为什么

发生这种情况的代码

<script type="text/javascript">
$('.delete-btn').click(function() {
 $.ajax(function() {
    type: 'POST',
    url: 'ajax.php',
    data: { filename: filename },
    success: function(return) {
        if(return == 'SUCCESS') {
            $this = $(this).closest('tr');
            $this.remove();
        }
    }
});
});
</script>

$('.delete btn')。单击(函数(){
$.ajax(函数(){
键入:“POST”,
url:'ajax.php',
数据:{filename:filename},
成功:函数(返回){
if(return==“SUCCESS”){
$this=$(this.closest('tr');
$this.remove();
}
}
});
});

我希望有人能找到我为什么会得到未使用的令牌:在url:'ajax.php',rule.

语法错误在您的
成功
回调中。您已将参数命名为
return
,它是一个保留字。换个说法吧


Niet在这里,将我的答案合并到这个答案中,以完成图片:

更改:

$.ajax(function() {
致:


请密切注意您正在编写的内容:p

语法错误出现在您的
success
回调中。您已将参数命名为
return
,它是一个保留字。换个说法吧


Niet在这里,将我的答案合并到这个答案中,以完成图片:

更改:

$.ajax(function() {
致:


请密切注意您正在编写的内容:p

语法错误出现在您的
success
回调中。您已将参数命名为
return
,它是一个保留字。换个说法吧


Niet在这里,将我的答案合并到这个答案中,以完成图片:

更改:

$.ajax(function() {
致:


请密切注意您正在编写的内容:p

语法错误出现在您的
success
回调中。您已将参数命名为
return
,它是一个保留字。换个说法吧


Niet在这里,将我的答案合并到这个答案中,以完成图片:

更改:

$.ajax(function() {
致:


请密切注意您正在编写的内容:p

return
是javascript中的一个关键字不要将其用作
变量名

 <script type="text/javascript">
    $('.delete-btn').click(function() {
     $.ajax(function() {
        type: 'POST',
        url: 'ajax.php',
        data: { filename: filename },
        success: function(data) {
            if(data== 'SUCCESS') {
                $this = $(this).closest('tr');
                $this.remove();
            }
        }
    });
    });
    </script>

$('.delete btn')。单击(函数(){
$.ajax(函数(){
键入:“POST”,
url:'ajax.php',
数据:{filename:filename},
成功:功能(数据){
如果(数据==“成功”){
$this=$(this.closest('tr');
$this.remove();
}
}
});
});

return
是javascript的一个关键字,不要将其用作
变量名

 <script type="text/javascript">
    $('.delete-btn').click(function() {
     $.ajax(function() {
        type: 'POST',
        url: 'ajax.php',
        data: { filename: filename },
        success: function(data) {
            if(data== 'SUCCESS') {
                $this = $(this).closest('tr');
                $this.remove();
            }
        }
    });
    });
    </script>

$('.delete btn')。单击(函数(){
$.ajax(函数(){
键入:“POST”,
url:'ajax.php',
数据:{filename:filename},
成功:功能(数据){
如果(数据==“成功”){
$this=$(this.closest('tr');
$this.remove();
}
}
});
});

return
是javascript的一个关键字,不要将其用作
变量名

 <script type="text/javascript">
    $('.delete-btn').click(function() {
     $.ajax(function() {
        type: 'POST',
        url: 'ajax.php',
        data: { filename: filename },
        success: function(data) {
            if(data== 'SUCCESS') {
                $this = $(this).closest('tr');
                $this.remove();
            }
        }
    });
    });
    </script>

$('.delete btn')。单击(函数(){
$.ajax(函数(){
键入:“POST”,
url:'ajax.php',
数据:{filename:filename},
成功:功能(数据){
如果(数据==“成功”){
$this=$(this.closest('tr');
$this.remove();
}
}
});
});

return
是javascript的一个关键字,不要将其用作
变量名

 <script type="text/javascript">
    $('.delete-btn').click(function() {
     $.ajax(function() {
        type: 'POST',
        url: 'ajax.php',
        data: { filename: filename },
        success: function(data) {
            if(data== 'SUCCESS') {
                $this = $(this).closest('tr');
                $this.remove();
            }
        }
    });
    });
    </script>

$('.delete btn')。单击(函数(){
$.ajax(函数(){
键入:“POST”,
url:'ajax.php',
数据:{filename:filename},
成功:功能(数据){
如果(数据==“成功”){
$this=$(this.closest('tr');
$this.remove();
}
}
});
});

return
是JavaScript中的保留字。使用除return以外的任何其他名称。我使用了数据而不是返回。另外,您编写的ajax函数中存在类型错误。更新了同样的内容。使用下面的代码

<script type="text/javascript">
$('.delete-btn').click(function() {
 $.ajax({
    type: 'POST',
    url: 'ajax.php',
    data: { filename: filename },
    success: function(data) {
        if(data == 'SUCCESS') {
            $this = $(this).closest('tr');
            $this.remove();
        }
    }
});
});
</script>

$('.delete btn')。单击(函数(){
$.ajax({
键入:“POST”,
url:'ajax.php',
数据:{filename:filename},
成功:功能(数据){
如果(数据==“成功”){
$this=$(this.closest('tr');
$this.remove();
}
}
});
});

return
是JavaScript中的保留字。使用除return以外的任何其他名称。我使用了数据而不是返回。另外,您编写的ajax函数中存在类型错误。更新了同样的内容。使用下面的代码

<script type="text/javascript">
$('.delete-btn').click(function() {
 $.ajax({
    type: 'POST',
    url: 'ajax.php',
    data: { filename: filename },
    success: function(data) {
        if(data == 'SUCCESS') {
            $this = $(this).closest('tr');
            $this.remove();
        }
    }
});
});
</script>

$('.delete btn')。单击(函数(){
$.ajax({
键入:“POST”,
url:'ajax.php',
数据:{filename:filename},
成功:功能(数据){
如果(数据==“成功”){
$this=$(this.closest('tr');
$this.remove();
}
}
});
});

return
是JavaScript中的保留字。使用除return以外的任何其他名称。我使用了数据而不是返回。另外,您编写的ajax函数中存在类型错误。更新了同样的内容。使用下面的代码

<script type="text/javascript">
$('.delete-btn').click(function() {
 $.ajax({
    type: 'POST',
    url: 'ajax.php',
    data: { filename: filename },
    success: function(data) {
        if(data == 'SUCCESS') {
            $this = $(this).closest('tr');
            $this.remove();
        }
    }
});
});
</script>

$('.delete btn')。单击(函数(){
$.ajax({
键入:“POST”,
url:'ajax.php',
数据:{filename:filename},
成功:功能(数据){
如果(数据==“成功”){
$this=$(this.closest('tr');
$this.remove();
}
}
});
});

return
是JavaScript中的保留字。使用除return以外的任何其他名称。我使用了数据而不是返回。另外,您编写的ajax函数中存在类型错误。更新了同样的内容。使用下面的代码

<script type="text/javascript">
$('.delete-btn').click(function() {
 $.ajax({
    type: 'POST',
    url: 'ajax.php',
    data: { filename: filename },
    success: function(data) {
        if(data == 'SUCCESS') {
            $this = $(this).closest('tr');
            $this.remove();
        }
    }
});
});
</script>

$('.delete btn')。单击(函数(){
$.ajax({
键入:“POST”,
url:'ajax.php',
数据:{filename:filename},
成功:功能(数据){
如果(数据==“成功”){
$this=$(this.closest('tr');
$this.remove();
}
}
});
});

return
是一个关键字。
return
是一个关键字。
return
是一个关键字。
return
是一个关键字。很好,+1对于你来说,不仅仅是为了寻找语法错误!我已经合并了我们的答案,你可以