Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Update README in response to https://github.com/igrigorik/closure-sprock... #9

Merged
merged 1 commit into from

2 participants

@dogenpunk

...ets/issues/2

Issue is with code running before the DOM is loaded (as far as I can tell)

@igrigorik igrigorik merged commit e26b68f into from
@igrigorik
Owner

Thanks!

@dogenpunk

Now problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 2 deletions.
  1. +6 −2 README.md
View
8 README.md
@@ -21,8 +21,12 @@ The gem ships with a Railtie which will automatically register a Closure preproc
// in one of your javascript files
goog.require('goog.dom');
-newHeader = goog.dom.createDom('h1', {}, 'Hello world!');
-goog.dom.appendChild(document.body, newHeader);
+function sayHello() {
+ newHeader = goog.dom.createDom('h1', {}, 'Hello world!');
+ goog.dom.appendChild(document.body, newHeader);
+};
+
+window.onload = sayHello;
```
You can also add a `name.soy` template in your assets folder, and it will be automatically compiled to Javascript for you! Ex:
Something went wrong with that request. Please try again.