sample HTML to test javascript codes

luislondon

New Member
I have just started learning Javascript and Ok here is a code I want to try and see it in the browser, so I create a test.js file and put this in it:\[code\]function useless(callback) { return callback}var text = 'Amigo';assert( useless(function(){ return text; }) === text, "The useless function works! " + text);\[/code\]But still there is more, I should write a minimum HTML page than can call this function, What is sample HTML to host this method in it? I have written something like this but still there is something wrong with it:\[code\]<!DOCTYPE html><html><head> <title></title></head><body><script src="http://stackoverflow.com/questions/15797262/hehe.js" > useless('Amigo'); window.onload=useless('Amigo')</script></body></html>\[/code\]
 
Top