playframework/Play20 — pull request #761 by julienrf (2013-02-20 15:16:00+00:00)
Title: Add views.helper.json

Add a `views.helper.json` function that makes it easier to generate JavaScript values.

That’s useful when your HTML templates build some JavaScript data from your template parameters.

E.g. [this line of code](https://github.com/playframework/Play20/blob/master/samples/scala/websocket-chat/app/views/chatRoom.scala.html#L60) will fail if `username` contains a quote. It could simply be replaced with:

```javascript
if (data == @helper.json(username)) $(el).addClass('me')
```