diff options
author | Vincent Sanders <vince@netsurf-browser.org> | 2012-07-30 22:31:20 +0100 |
---|---|---|
committer | Vincent Sanders <vince@netsurf-browser.org> | 2012-07-30 22:54:14 +0100 |
commit | f207f14be1e95d0c1fa1866decf2c07a119ba8fe (patch) | |
tree | 895237614c4881ccbcdc7742de07ec43ec4b8f09 /test/js/assorted.html | |
parent | 72fe92d9ca0d3ba06c56cc258575e42102d502c6 (diff) | |
download | netsurf-f207f14be1e95d0c1fa1866decf2c07a119ba8fe.tar.gz netsurf-f207f14be1e95d0c1fa1866decf2c07a119ba8fe.tar.bz2 |
simple script tests
Diffstat (limited to 'test/js/assorted.html')
-rw-r--r-- | test/js/assorted.html | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/js/assorted.html b/test/js/assorted.html new file mode 100644 index 000000000..bb3d477bc --- /dev/null +++ b/test/js/assorted.html @@ -0,0 +1,34 @@ +<html> +<head><title>moo</title></head> +<body> +<script> +var tree = (this ===window) +console.log(tree); +var string = "50"; + +console.log(string + 100); // 50100 +console.log(+string + 100); // 150 + +string = parseInt(string, 10); +console.log(string + 100); // 150 +var binary = parseInt("110010", 2); +console.log(binary); // 50 + +function doSomething(param) { + param = param.toUpperCase(); // param is now a local variable + console.log(param); +} +var string = "test"; + +/* note that string will be passed in by reference */ +doSomething(string); // TEST +console.log(string); // test + +document.write("<p>Hello World!<p>"); +</script> +<p>one</p> +<script>document.write("<scr" +"ipt>document.write(\"Goodbye Cruel World\");</scri" + "pt>");</script> +</script> +<p>hi</p> +</body> +</html> |