Skip to content

Commit

Permalink
Sync with origin
Browse files Browse the repository at this point in the history
  • Loading branch information
amarcruz committed Feb 12, 2016
2 parents 3259d56 + 9ea69b9 commit 667c071
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions doc/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,20 @@ The filename in `src` can be absolute or relative. If you pass a third parameter

Without a `type=` directive, the JavaScript parser defaults to the `type` specified in the options passed to the compiler. If you don't want the code to be parsed, use `type="none"`.

If you just want to get the `script` tag rendered, keeping the `type`
attribute and the tag contents untouched, you should then use the `defer`
attribute.

The `defer` attribute is used to avoid the processing of the `script` tag
during the Riot compile time, which would threat them as 'code to be
evaluated'. This will be deferred to happen just on the final renderer context
(e.g. Web Browsers).
This can be useful for example on Server Side Rendering (SSR) of plain
old HTML files. Riot Tags in this context would include some logic inside
`script` tags designed to be run on just on the Client (e.g. To provide
animations). The original `defer` attribute is also removed during the
rendering of the final emitted `script` tag.

The encoding is specified by the `charset` attribute. It defaults to `utf8`.

Example:
Expand Down

0 comments on commit 667c071

Please sign in to comment.