From 06e25674333eca99803356351c0d808237742fcf Mon Sep 17 00:00:00 2001 From: Karl Bryan Paragua Date: Fri, 1 May 2015 13:06:56 +0800 Subject: [PATCH] Update README.md --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index ce4db48..33c7150 100644 --- a/README.md +++ b/README.md @@ -277,6 +277,22 @@ Inside this HTML hook is where the magic happens. This is the reason why Paloma Ideally, you just need to call `insert_paloma_hook` in your layouts, since the layout will always be included in every rendered view. But if you are rendering a view without a layout, make sure to call `insert_paloma_hook` in that view. + +## AJAX + +1. Make sure that the AJAX response contains the html hook. (use `insert_paloma_hook`) +2. Execute the hook and start Paloma's engine on complete/success. + + ```js + $.get('http://example.com', function(response){ + $('#result').html(response); + + // Execute Paloma hook and start the engine. + Paloma.executeHook(); + Palama.engine.start(); + }); + ``` + ## Turbolinks Support As of version `4.1.0`, Paloma is compatible with Turbolinks without additional setup.