1. some stupid things
    1. if else java style
    2. for(var x=0;x<2;x++)
    3. Array
      1. var somearray = new Array();
      2. var 2Darray = new Array(new Array(2),new Array(3));
    4. function
      1. function changeImage(xyz)
        1. Remember no var is required for xyz.... inside the method signature
        2. But xyz act as local variable
      2. return x;
      3. var funcName = changeImage;
        1. No function bracket
        2. funcName("some stupid thing");
      4. Callback
        1. browser supported callback method
          1. e.g.,
          2. onload
          3. onclick
          4. window.onload = changeImage;
          5. Just Referencing the method.. not calling it
          6. How it work ??
          7. Onload happen ===> window.onload() ===> call changeImage()
          8. Adv...
          9. No need to put those event handling thing in the html like onclick etc
          10. Disadv...
          11. How to pass variable inside method...
          12. function literal
          13. document.getElementById("abc").onclick = function(evt){ changeImage(123);}
          14. also called as anonymous functions
          15. window.onload = function(){ ... }
          16. In this method other function literal can be called
          17. So When ever HTML page get unloaded, you have to initialize all the function literal methods.
  2. Browser
    1. cookie
      1. document.cookie
      2. navigator.cookieEnabled
  3. Form and Validation
    1. Accessing element
      1. getElementById()
      2. form object
        1. Step 1: onclick="showIt(this.form)"
          1. Instead of sending this.form... only this can be passed...
        2. Step 2: function showIt(theForm){ theForm["zipcode"].value };
        3. form.submit();
    2. When to validate??
      1. Select the input field... onfocus
      2. Leave the input field and move to the next one... onblur/onchange
        1. onchange only diffrence is ... contents needs to be changed
        2. onchange should not be used...bcoz it won't get trigger for empty element.
    3. Regular Expression
      1. Pattern
        1. pattern = ###
          1. all numeric
        2. pattern = /^\d{5}$/
          1. All regular expr.. enclosed by /
          2. d ==> a single numeric digit
          3. {5} ==> The single digit must repeat 5 times
          4. $ ==> The string must end with this pattern
      2. char overview
        1. .
          1. Match any char other than new line
        2. *
          1. 0 or more times
        3. 1
          1. 1 or more times
        4. ?
          1. 0 or 1 times
        5. {n}
          1. repeat n times
          2. e.g., /\d{4}/
          3. Digit should be repeated 4 times
          4. e.g., 3000
        6. ()
          1. Group something
        7. \s
          1. Match a whitespace char
        8. \d
          1. match any numeric digit
        9. ^
          1. The string must begin with the pattern
        10. \w
          1. match any alpha numeric char
        11. $
          1. The string must end with the pattern
      3. example
        1. /^cat/
          1. category
          2. cat
          3. cat123
          4. 123cat
        2. /\d\d\d/
          1. 007
        3. /^\d\d\d\d$/
          1. AUS zip code
          2. must start with the pattern
          3. must end with the pattern
          4. 4 digit in a row
          5. e.g., 3000
        4. /^\d{5}-\d{4}$/
          1. e.g., 40012-3214
        5. /\w*/
          1. Any number of alpha numberic
          2. encluding empty string
      4. with JS
        1. var regex = \^/d{4}$\;
          1. No double quote
          2. remember the back slash
        2. if(!regex.test(othervar))