June 22, 2016. Javascript Notes. ________________________________________ EXTERNAL FILES //To use javascript in the file temp.js: var1=readTextFile("file:///C:/Users/erasmuse/Downloads/javascript.txt") alert("var1") ______________________________ Writing on the screen window: document.write("Here is something to write.") ------------------------------- MAKES X INTO STRING, NOT # x1 =x.toString() -------------------------------- MAKES TEXT BOX APPEAR alert("Show a box with this writing in it that the user has to click OK on to get rid of.") __________________________ var1= prompt("What is your name?", ""); MAKES BOX APPEARAND GIVES SPACE FOR WRITING BELOW A PROMPT(vAR1 WILL BE WHAT YOU WRITE INTHE BLANK SPACE) ___________________________________________ // Here is a comment. ______________________________________ Escape sEQUENCES: \\ FOR A BACKSLASH \n MEANS NEW LINE --------------------- \ GETS RID OF AUTO SEMI COLON AT THe end of a line. ________________________________ TO GET THE LENGTH OF A STRING: y = "bendasdasasasd" z = y.length MAKES X INTO STRING, NOT # x1 =x.toString() __________________________ BUTTON HTML TO GENERATE A NEW BUTTON ************************************************** MAKING A BUTTON DO SOMETHING WHEN PRESSED: *************************************** MAKING A CHECKBOX DO SOMETHING ************************ ************************