gpt4 book ai didi

javascript - CoffeeScript 缩进

转载 作者:行者123 更新时间:2023-11-30 08:54:53 27 4
gpt4 key购买 nike

我收到这些行的缩进错误

有没有在线验证器可以帮助我?

showAliveTests : (pageIndex, statusFilter) ->
data=
pageIndex:pageIndex
status:statusFilter
$.ajax
url:'/ManageConfiguration/GetAliveConfigurations/' + location.search
type:"post"
data:data
dataType:"json"
success:(res)->
if res.status == "failed"
alert res.body
else
$('#viewConfigurationTable tr').remove()
newRow = $ '<tr>'
newRow.append('<td>Id</td>
<td>Name</td>
<td>Status</td>
<td>Ctids</td>
<td>CreationDate</td>')
$('#viewConfigurationTable').append(newRow)
for obj in res.body
newRow = $ '<tr>'
newRow.append('<td>'+obj.Id+'</td>
<td>'+obj.Name+'</td>
<td>'+obj.Status+'</td>
<td>'+obj.Ctids+'</td>
<td>'+obj.CreationDate+'</td>')
$('#viewConfigurationTable').append(newRow)
$(#paginator a).remove()
for i in [0..count] by 1
$(#paginator).append('<a href=#>'+i+'</a>')

error:(e)->
alert 'An error has occured: ' + e

最佳答案

www.coffeescript.org -> 点击试试我,将你的代码粘贴进去,你会看到哪一行抛出错误。

在您的情况下,即使使用 stackoverflow 代码突出显示也可以看到它:

$(#paginator a).remove() -> wrong
$('#paginator a').remove() -> correct

第二个错误

$(#paginator).append('<a href=#>'+i+'</a>')  -> wrong
$('#paginator').append('<a href=#>'+i+'</a>') -> correct

关于javascript - CoffeeScript 缩进,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14442492/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com