JavaScript 와 JSON =================== JavaScript ---------- Xitrum은 jQuery를 내포하고 있습니다. 또한 일부 jsXXX 헬퍼도 제공하고 있습니다. JavaScript 조각을 View에 추가하는 방법 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 액션 내에서 ``jsAddToView`` 를 호출합니다.(필요한 경우 여러 번 호출이 가능합니다): :: class MyAction extends AppAction { def execute() { ... jsAddToView("alert('Hello')") ... jsAddToView("alert('Hello again')") ... respondInlineView(
My view
) } } 레이아웃 내에서 ``jsForView`` 를 호출합니다: :: import xitrum.Action import xitrum.view.DocType trait AppAction extends Action { override def layout = DocType.html5( {antiCsrfMeta} {xitrumCss} {jsDefaults}Could not login.
))) Javascript로 리다이렉션하는 경우: :: jsRedirectTo("http://cntt.tv/") jsRedirectTo[LoginAction]() JSON ---- Xitrum은 `JSON4S