Methods                                                                                                   DOM Methods


                          JavaScript
              Object                                                                                              Document
             toString                                                                                             clear
      toLocaleString                                                                                              createDocument
              valueOf                                                                                             createDocumentFragment
    hasOwnProperty                                                                                                createElement
       isPrototypeOf                                                                                              createEvent
propertyIsEnumerable     XMLHttpRequest                             REGULAR EXPRESSIONS - FORMAT                  createEventObject
                                                                                                                  createRange
                         Safari, Mozilla, Opera:                    Regular expressions in JavaScript take
               String                                                                                             createTextNode
               charAt        var req = new XMLHttpRequest();        the form:                                     getElementsByTagName
         charCodeAt      Internet Explorer:                         var RegEx = /pattern/modifiers;               getElementById
      fromCharCode           var req = new                                                                        write
               concat
                             ActiveXObject("Microsoft.XMLHTTP");    REGULAR EXPRESSIONS - MODIFIERS
             indexOf                                                                                              Node
         lastIndexOf                                                                                              addEventListener
     localeCompare       XMLHttpRequest Object Methods              /g        Global matching                     appendChild
               match                                                /i        Case insensitive                    attachEvent
              replace                                                                                             cloneNode
                         abort()                                    /s        Single line mode
               search                                                                                             createTextRange
                 slice   getAllResponseHeaders()                    /m        Multi line mode                     detachEvent
                 split   getResponseHeader(header)                                                                dispatchEvent
            substring    open(method, URL)                                                                        fireEvent
                                                                    REGULAR EXPRESSIONS - PATTERNS
               substr                                                                                             getAttributeNS
                         send(body)
        toLowerCase                                                                                               getAttributeNode
        toUpperCase               setRequestHeader(header, value)   ^            Start of string                  hasChildNodes
 toLocaleLowerCase                                                  $            End of string                    hasAttribute
 toLocaleUpperCase       XMLHttpRequest Object Properties           .            Any single character             hasAttributes
                                                                                                                  insertBefore
                                                                    (a|b)        a or b
              RegEx                                                                                               removeChild
                         onreadystatechange                         (...)        Group section                    removeEventListener
                 test
              match      readyState                                 [abc]        Item in range (a or b or c)      replaceChild
                exec     responseText                               [^abc]       Not in range (not a or b or c)   scrollIntoView
                         responseXML                                a?           Zero or one of a
               Array                                                                                              Form
                         status                                     a*           Zero or more of a                submit
              concat
                 join    statusText                                 a+           One or more of a
                push                                                a{3}         Exactly 3 of a                   DOM Collections
                 pop                                                                                              item
                         XMLHttpRequest readyState Values           a{3,}        3 or more of a
             reverse
                shift                                               a{3,6}     Between 3 and 6 of a               Range
                slice    0         Uninitiated                      !(pattern) "Not" prefix. Apply rule when      collapse
                 sort    1         Loading                                       URL does not match pattern.      createContextualFragment
               splice    2         Loaded                                                                         moveEnd
              unshift                                                                                             moveStart
                         3         Interactive                                                                    parentElement
                                                                    EVENT HANDLERS
            Number       4         Complete                                                                       select
             toFixed                                                onAbort                onMouseDown            setStartBefore
       toExponential
                         JAVASCRIPT IN HTML                         onBlur                 onMouseMove
          toPrecision                                                                                             Style
                                                                    onChange               onMouseOut             getPropertyValue
                         External JavaScript File
                Date                                                onClick                onMouseOver            setProperty
                          <script type="text/javascript"
                parse                                               onDblClick             onMouseUp
                          src="javascript.js"></script>
       toDateString                                                                                               Event
                         Inline JavaScript                          onDragDrop             onMove
       toTimeString                                                                                               initEvent
             getDate      <script type="text/javascript">           onError                onReset                preventDefault
              getDay       <!--                                     onFocus                onResize               stopPropagation
         getFullYear          // JavaScript Here                    onKeyDown              onSelect
            getHours       //-->                                                                                  XMLSerializer
                                                                    onKeyPress             onSubmit
     getMilliseconds                                                                                              serializeToString
                          </script>                                 onKeyUp                onUnload
         getMinutes
           getMonth                                                 onLoad                                        XMLHTTP
         getSeconds                                                                                               open
             getTime     Functions                                                                                send
 getTimezoneOffset                                                  FUNCTIONS AND METHODS
             getYear     Window               Built In                                                            XMLDOM
                         alert                eval                  A method is a type of function, associated
             setDate                                                                                              loadXML
            setHours     blur                 parseInt              with an object. A normal function is not
     setMilliseconds     clearTimeout         parseFloat            associated with an object.                    DOMParser
          setMinutes     close                isNaN                                                               parseFromString
           setMonth      focus                isFinite
                         open                 decodeURI                         Available free from
         setSeconds
              setYear    print                decodeURIComponent                 AddedBytes.com
 toLocaleTimeString      setTimeout           encodeURI
                                              encodeURIComponent
                                              escape
                                              unescape

javascript-cheat-sheet-v1_1

  • 1.
    Methods DOM Methods JavaScript Object Document toString clear toLocaleString createDocument valueOf createDocumentFragment hasOwnProperty createElement isPrototypeOf createEvent propertyIsEnumerable XMLHttpRequest REGULAR EXPRESSIONS - FORMAT createEventObject createRange Safari, Mozilla, Opera: Regular expressions in JavaScript take String createTextNode charAt var req = new XMLHttpRequest(); the form: getElementsByTagName charCodeAt Internet Explorer: var RegEx = /pattern/modifiers; getElementById fromCharCode var req = new write concat ActiveXObject("Microsoft.XMLHTTP"); REGULAR EXPRESSIONS - MODIFIERS indexOf Node lastIndexOf addEventListener localeCompare XMLHttpRequest Object Methods /g Global matching appendChild match /i Case insensitive attachEvent replace cloneNode abort() /s Single line mode search createTextRange slice getAllResponseHeaders() /m Multi line mode detachEvent split getResponseHeader(header) dispatchEvent substring open(method, URL) fireEvent REGULAR EXPRESSIONS - PATTERNS substr getAttributeNS send(body) toLowerCase getAttributeNode toUpperCase setRequestHeader(header, value) ^ Start of string hasChildNodes toLocaleLowerCase $ End of string hasAttribute toLocaleUpperCase XMLHttpRequest Object Properties . Any single character hasAttributes insertBefore (a|b) a or b RegEx removeChild onreadystatechange (...) Group section removeEventListener test match readyState [abc] Item in range (a or b or c) replaceChild exec responseText [^abc] Not in range (not a or b or c) scrollIntoView responseXML a? Zero or one of a Array Form status a* Zero or more of a submit concat join statusText a+ One or more of a push a{3} Exactly 3 of a DOM Collections pop item XMLHttpRequest readyState Values a{3,} 3 or more of a reverse shift a{3,6} Between 3 and 6 of a Range slice 0 Uninitiated !(pattern) "Not" prefix. Apply rule when collapse sort 1 Loading URL does not match pattern. createContextualFragment splice 2 Loaded moveEnd unshift moveStart 3 Interactive parentElement EVENT HANDLERS Number 4 Complete select toFixed onAbort onMouseDown setStartBefore toExponential JAVASCRIPT IN HTML onBlur onMouseMove toPrecision Style onChange onMouseOut getPropertyValue External JavaScript File Date onClick onMouseOver setProperty <script type="text/javascript" parse onDblClick onMouseUp src="javascript.js"></script> toDateString Event Inline JavaScript onDragDrop onMove toTimeString initEvent getDate <script type="text/javascript"> onError onReset preventDefault getDay <!-- onFocus onResize stopPropagation getFullYear // JavaScript Here onKeyDown onSelect getHours //--> XMLSerializer onKeyPress onSubmit getMilliseconds serializeToString </script> onKeyUp onUnload getMinutes getMonth onLoad XMLHTTP getSeconds open getTime Functions send getTimezoneOffset FUNCTIONS AND METHODS getYear Window Built In XMLDOM alert eval A method is a type of function, associated setDate loadXML setHours blur parseInt with an object. A normal function is not setMilliseconds clearTimeout parseFloat associated with an object. DOMParser setMinutes close isNaN parseFromString setMonth focus isFinite open decodeURI Available free from setSeconds setYear print decodeURIComponent AddedBytes.com toLocaleTimeString setTimeout encodeURI encodeURIComponent escape unescape