Created
March 26, 2016 21:34
-
-
Save tekniklr/b593813f1a1eaa9f1230 to your computer and use it in GitHub Desktop.
Revisions
-
tekniklr created this gist
Mar 26, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ <!DOCTYPE html> <html lang='en'> <head> <meta charset='utf-8'> <meta content='IE=edge,chrome=1' http-equiv='X-UA-Compatible'> <meta content='text/html;charset=utf-8' http-equiv='Content-Type'> <title>null</title> <!-- was curious how this ( http://gizmodo.com/it-really-sucks-to-be-named-jennifer-null-1767159091 ) even happens - how does a form input validate a string value from a submitted form as equivalent to null??? --> <script type="text/javascript"> function do_it() { var the_thing = document.getElementById('the_thing').value; var interpreted_thing = ''; if (the_thing == null) { interpreted_thing = 'literally null'; } else if (the_thing == '') { interpreted_thing = 'blank'; } else { interpreted_thing = the_thing; } alert('yo, the thing is '+interpreted_thing); } </script> </head> <body> <form> <label for="the_thing">The thing:</label> <input type="text" id="the_thing" /> <input type="submit" value="what" onclick="javascript:do_it(); return false;" /> </form> </body> </html>