TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

<script type="text/coffeescript">

37 点作者 meddah大约 15 年前

7 条评论

tr4nslator大约 15 年前
I think this should probably point here:<p><a href="http://jashkenas.github.com/coffee-script/#scripts" rel="nofollow">http://jashkenas.github.com/coffee-script/#scripts</a><p>The salient point is that CoffeeScript now automatically compiles any code in a script tag with type text/coffeescript. Pretty cool.
jashkenas大约 15 年前
The gist of it is this. If you include the minified version of the CoffeeScript compiler on a webpage (43k, gzipped), it will compile and evaluate the inline coffeescripts on the page. That documentation site uses it to hook up the menu and the "Try CoffeeScript" demonstration in the toolbar.<p>If you view source, you'll see something along these lines:<p><pre><code> &#60;script type="text/coffeescript"&#62; window.repl_run: -&#62; try eval window.compiled_js catch error then alert error close_menus: -&#62; current_nav.removeClass 'active' if current_nav current_nav: null $(document.body).click -&#62; close_menus() &#60;/script&#62;</code></pre>
Freebytes大约 15 年前
While I like the concept of simplifying to increase productivity, I am not sure the source code of Coffeescript is any better than the original source code of JavaScript itself. The idea should be to simplify the languages, but as far as simplification is concerned, I think JavaScript is incredibly easy to learn and needs little simplification to its core syntax. There have been other projects, such as Dojo that make the complex tasks of JavaScript easier, and these I find incredibly useful, but to change the syntax of the language without significantly reducing the code size and complexity does not present a lot of value for the project. If this is expanded with one line AJAX scripts, the potential would be vastly improved for acceptance of this type of syntax replacement scheme.
bawatski大约 15 年前
<a href="http://news.ycombinator.com/item?id=1014080" rel="nofollow">http://news.ycombinator.com/item?id=1014080</a>
评论 #1150251 未加载
francoisdevlin大约 15 年前
It's hard to take this seriously when the CSS gets in the way...
scorciapino大约 15 年前
How does this compare with parenscript?
评论 #1150907 未加载
mahmud大约 15 年前
Any real languages targeting PHP as a backend? this piss poor excuse for a templating language is making my life harder than it needs to be.