You can use this method to add dynamic JS snippets to a buffer, then use method jsForView to take out that buffer to embed the snippets to view template.
Do not use this to escape JSON, because they are different! For example JSON does not escape ' character, while JavaScript does.
Do not use this to escape JSON, because they are different! For example JSON does not escape ' character, while JavaScript does. To escape JSON, use xitrum.util.SeriDeseri.toJson(Seq(string)).
org.apache.commons.lang3.StringEscapeUtils is used internally.
See jsAddToView.
See http://stackoverflow.com/questions/503093/how-can-i-make-a-redirect-page-in-jquery