I need some help to get js_of_ocaml working. There's not much information about it on the net, and the manual is very sparse (no snippets or usage examples, no comment sections).
I have a Card
module on the server with a card
record. I'm sending a card list
to the client using Ajax, and there I want to read and traverse this list. What I end up with is this:
let json = Json.unsafe_input (Js.string http_frame.XmlHttpRequest.content) in
...where json
has type 'a
, according to documentation (not when I run it, of course).
I can log json##length
and get the correct length of the list. Where do I go from here? Ideally, I'd like to use Deriving_Json
to type-safe get a card list
again, but I could also use a for-loop (not as elegant, but whatever).