我有以下咖啡脚本:
$("#complete").click ->
bootbox.dialog "Remember, if you complete the workorder you won't be able to add labor and materials.", [
label: "Complete"
class: "btn-success"
callback: ->
$("td").filter(':contains("ID:")').each ->
woid = $(this).nextAll().text()
$.update "/workorders/" + woid,
workorder:
wostatus_id: 232
,
label: "Cancel"
class: "btn-danger"
callback: ->
return 'false'
]
当它运行时,我在浏览器控制台中得到这个:
Uncaught ReferenceError: woid is not defined
谢谢您的帮助!