我有以下代碼,我嘗試用coffeescript編寫。
$.ajax {
type: 'GET'
url: '/dashboard'
success: (response) ->
$('.loading_row').remove()
dataType: 'script'
}
每次我嘗試運行此收到以下錯誤信息:
Assertion failed: (0 && "implement me"), function uv_fs_readlink, file src/unix/fs.c, line 613.
我可以把成功回調都在同一行解決這一點,但我想調用多個方法回調,所以這是行不通的。
$.ajax {
type: 'GET'
url: '/dashboard'
success: (response) -> $('.loading_row').remove()
dataType: 'script'
}
你必須更多地設置它......這看起來像jQuery,但是你得到的錯誤來自'c'文件。所以你在Node.js下運行它,對吧?使用'$ = require'jquery''並且您正在使用[jsdom](https://github.com/tmpvar/jsdom),以使'.remove()'行有意義? –
它在Rails 3.1下運行,jquery已被包含,並且該文件中的其他jquery行可以正常工作。不使用jsdom。 – Jeremy
好的...所以你在編譯時看到這個錯誤?那麼ExecJS使用的JavaScript環境可能會有問題。嘗試將'therubyracer'添加到您的Gemfile並運行'bundle install'。 –