This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
|
notes:javascript_cheat_sheet [2026/11/03 06:55] 216.73.216.55 old revision restored (2026/11/02 01:07) |
notes:javascript_cheat_sheet [2026/11/03 06:55] (current) 216.73.216.55 old revision restored (2026/11/01 19:45) |
||
|---|---|---|---|
| Line 69: | Line 69: | ||
| * Date objects include methods: getTime(epoch), | * Date objects include methods: getTime(epoch), | ||
| * Date objects can be compared using <, > . | * Date objects can be compared using <, > . | ||
| - | * To declare an array < | + | * To declare an array < |
| * Arrays have methods including: sort, concat, join. | * Arrays have methods including: sort, concat, join. | ||
| - | * To sort an integer array, must use a function < | + | * To sort an integer array, must use a function < |
| * The Math object contains common math routines: round, random, e, pi etc. | * The Math object contains common math routines: round, random, e, pi etc. | ||
| * The RegExp object supports regexp creation and searching including methods: test (t/f), exec, compile (alter). | * The RegExp object supports regexp creation and searching including methods: test (t/f), exec, compile (alter). | ||
| * HTML DOM objects allow access to browser and webpage. | * HTML DOM objects allow access to browser and webpage. | ||
| + | |||
| + | ==== Advanced JavaScript ==== | ||
| + | * navigator.appName/ | ||
| + | * document.cookie allows read and write access to cookie so to set a cookie <code javascript> | ||
| + | function setCookie(c_name, | ||
| + | { | ||
| + | var exdate=new Date(); | ||
| + | exdate.setDate(exdate.getDate()+expiredays); | ||
| + | document.cookie=c_name+ " | ||
| + | ((expiredays==null) ? "" | ||
| + | "; | ||
| + | } </ | ||
| + | * The onsubmit event can be used to validate a form. | ||
| + | * document.img_name.src =" | ||