Deploy to GitHub pages
This commit is contained in:
commit
2ef2c469d1
850 changed files with 332608 additions and 0 deletions
24
nimcache/runnableExamples/jsffi_examples_1.nim
Normal file
24
nimcache/runnableExamples/jsffi_examples_1.nim
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#[
|
||||
autogenerated by docgen
|
||||
loc: /home/runner/work/Nim/Nim/lib/js/jsffi.nim(16, 1)
|
||||
rdoccmd:
|
||||
]#
|
||||
import "/home/runner/work/Nim/Nim/lib/js/jsffi.nim"
|
||||
{.line: ("/home/runner/work/Nim/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!")
|
||||
)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue