【发布时间】:2016-04-13 23:20:55
【问题描述】:
我想在coffeescript 语法中使用.post jquery 方法来发出post 请求。 coffeescript 文档提供了添加成功回调的示例,但没有提供添加错误回调的语法。我该怎么做?
$.post '/',
userName: 'John Doe'
favoriteFlavor: 'Mint'
(data) -> $('body').append "Successfully posted to the page."
# Callback for error case?
【问题讨论】:
标签: javascript jquery ajax coffeescript