【发布时间】:2013-04-07 01:29:55
【问题描述】:
phantom = require 'phantom'
phantom.create (ph) ->
ph.createPage (page) ->
page.open "http://www.google.com", (status) ->
console.log "opened google? ", status
page.evaluate (-> document.title), (result) ->
console.log 'Page title is ' + result
ph.exit()
我尝试使用这个网站,但它似乎不是很准确。它到处都有回报。 http://js2coffee.org/#coffee2js
【问题讨论】:
-
如果您没有在 js 中显式返回某些内容,
js2coffee假定返回值无关紧要(因为您必须显式不在 coffeescript 中返回值)。