summary refs log blame commit diff stats
path: root/tests/ecmas.nim
blob: c25d063c14c4544275b879ecc29f50cc59693bd0 (plain) (tree)
1
2
3
4
5
6
7
8
9







                                                                 
                                                                         

                                  




                                        

                            
                                                                 
# This file tests the ECMAScript generator

import
  dom, strutils

# We need to declare the used elements here. This is annoying but
# prevents any kind of typo:
var
  inputElement {.importc: "document.form1.input1", nodecl.}: ref TElement

proc OnButtonClick() {.exportc.} =
  #var x = parseInt($inputElement.value)
  #echo($(x * x))
  var input = $inputElement.value
  echo "Test"
  echo "Hi, ", input

proc OnLoad() {.exportc.} = 
  echo "Welcome! Please take your time to fill in this formular!"