#[
autogenerated by docgen
loc: /build/nim/src/nim/lib/js/jsffi.nim(16, 1)
rdoccmd: 
]#
import std/assertions
import "/build/nim/src/nim/lib/js/jsffi.nim"
{.line: ("/build/nim/src/nim/lib/js/jsffi.nim", 16, 1).}:
  # Here, we are using jQuery for just a few calls and do not want to wrap the
  # whole library:

  # import the document object and the console
  var document {.importc, nodecl.}: JsObject
  var console {.importc, nodecl.}: JsObject
  # import the "$" function
  proc jq(selector: JsObject): JsObject {.importjs: "$$(#)".}

  # Use jQuery to make the following code run, after the document is ready.
  # This uses an experimental `.()` operator for `JsObject`, to emit
  # JavaScript calls, when no corresponding proc exists for `JsObject`.
  proc main =
    jq(document).ready(proc() =
      console.log("Hello JavaScript!")
    )

