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 characters
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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 characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Vanilla JS DOM Fun</title> | |
| <style> | |
| #p1 {background-color: orange} | |
| .done {font-style: italic;} | |
| </style> | |
| </head> |
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 characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Odd Check!</title> | |
| <style> | |
| .errMsg {color: red; font-style: italic;} | |
| output {background-color: orange; | |
| width: 40%; text-align: center; |
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 characters
| /** | |
| * function funname - does something cool | |
| */ | |
| JS.funname = function() { | |
| // Debug-start | |
| if (JS.DEBUG) { console.log("Entering funname function"); } | |
| // Debug-end | |
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 characters
| <!doctype html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>JavaScript Hello World</title> | |
| </head> | |
| <body> | |
| <h1>First HTML Based JavaScript</h1> | |
| <hr> | |
| <script> |
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 characters
| function doAlert(s) { | |
| alert("I am doing an alert and it says " + s); | |
| } |
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 characters
| for (var aProp in window.navigator) { | |
| document.write("window.navigator." + aProp + " = " + window.navigator[aProp] + "<br>"); | |
| } |
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 characters
| var stooge = "Moe"; | |
| switch (stooge) { | |
| case "Moe" : document.write("Why I outta..."); | |
| break; | |
| case "Larry" : document.write("Hey Moe"); | |
| break; |
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 characters
| for (var i = 0 ; i <= 25; i+= 5) { | |
| document.write("i = " + i + "<br>"); | |
| } |
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 characters
| var myName, myAge, likeDogs; | |
| myName = "Joe P. Somolovich"; | |
| myAge = 31; | |
| likeDogs = true; | |
| document.write("Hi my name is " + myName); | |
| document.write(" and I am " + myAge + " years old."); | |
| if (likeDogs) |