Hi Snap team,
am enjoying learning your framework.
I am trying to dynamically inject some json data into a page: <script>var json
= {} </script>.
At first I tried bindString to support something like <script><json/></script>
but Heist ignores (correctly I guess?) or alternatively escapes if I decide to
pull the script tags into my string.
So then tried creating the nodes using Blaze as follows:
jsonSplice :: Splice Application
jsonSplice = return . renderHtml $ do
H.script "var json = {}"
but get the following:
Couldn't match expected type `X.Node'
with actual type `hexpat-0.19.6:Text.XML.Expat.Tree.NodeG
[] BS.ByteString BS.ByteString'
Expected type: Splice Application
Actual type: TemplateMonad Application Forest
Apologies if I am missing something obvious but this has me stumped, given the
expected and actual types look equivalent to me.
I guess more broadly, am I taking the right approach to this?
Appreciate any guidance, cheers, Todd
_______________________________________________
Snap mailing list
[email protected]
http://mailman-mail5.webfaction.com/listinfo/snap