Skip to content

Commit 45dc702

Browse files
committed
Merge branch 'sreid'
Conflicts: authors.textile
2 parents 43107d4 + 4cca3a3 commit 45dc702

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

authors.textile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ _The following people are totally rad and awesome because they have contributed
99

1010
* David Brady [email protected]_
1111
* John Ford [email protected]_
12+
* Steven Reid _steven @ reidnorthwest . com_
1213
* ...You! What are you waiting for? Check out the <a href="/contributing">contributing</a> section and get cracking!
1314

1415

chapters/syntax/embedding_javascript.textile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,20 @@ chapter: Syntax
66

77
h2. Problem
88

9-
You want to include some found/pre-written JavaScript code inline with your CoffeeScript
9+
You want to include some found/pre-written JavaScript code inline with your CoffeeScript.
1010

1111
h2. Solution
1212

1313
Wrap the JavaScript with backticks:
1414

1515
{% highlight coffeescript %}
1616
`function greet(name) {
17-
alert("Hello "+name);
17+
return "Hello "+name;
1818
}`
1919

2020
# Back to CoffeeScript
2121
greet "Coffee"
22+
# => "Hello Coffee"
2223
{% endhighlight %}
2324

2425
h2. Discussion
@@ -27,9 +28,10 @@ This is a simple way to integrate small snippets of JavaScript code into your Co
2728

2829
{% highlight coffeescript %}
2930
hello = `function (name) {
30-
alert("Hello "+name)
31+
return "Hello "+name
3132
}`
3233
hello "Coffee"
34+
# => "Hello Coffee"
3335

3436
{% endhighlight %}
3537
Here the "hello" variable is still in CoffeeScript, but is assigned a function written in JavaScript.

0 commit comments

Comments
 (0)