
JavaScript and Browser Objects Quick Reference JavaScript Bible, 6th Edition Danny Goodman Appendix A ©2007 Danny Goodman (dannyg.com). All Rights Reserved. 2 JavaScript Bible, 6th Edition. ©2007 Danny Goodman (dannyg.com). All Rights Reserved. JavaScript and Browser Objects Quick Reference String 28 Date 30 Control Statements 32 constructor anchor("anchorName") constructor getFullYear() if (condition) { length big() prototype getYear() statementsIfTrue prototype blink() getMonth() } bold() getDate() charAt(index) getDay() if (condition) { charCodeAt([i]) getHours() statementsIfTrue concat(string2) getMinutes() } else { fixed() getSeconds() statementsIfFalse fontcolor(#rrggbb) getTime() } fontsize(1to7) getMilliseconds() fromCharCode(n1...)* getUTCFullYear() result = condition ? expr1 : expr2 indexOf("str" [,i]) getUTCMonth() italics() getUTCDate() for ([init expr]; [condition]; [update expr]) { lastIndexOf("str" [,i]) getUTCDay() statements link(url) getUTCHours() } localeCompare() getUTCMinutes() match(regexp) getUTCSeconds() for (var in object) { replace(regexp,str) getUTCMilliseconds() statements search(regexp) parse("dateString")* } slice(i,j) setYear(val) small() setFullYear(val) for each ([var] varName in objectRef) { split(char) setMonth(val) statements strike() setDate(val) }M1.8.1 sub() setDay(val) substr(start,length) setHours(val) with (objRef) { substring(intA, intB) setMinutes(val) statements sup() setSeconds(val) } toLocaleLowerCase() setMilliseconds(val) toLocaleUpperCase() setTime(val) do { toLowerCase() setUTCFullYear(val) statements toString() setUTCMonth(val) } while (condition) toUpperCase() setUTCDate(val) valueOf() setUTCDay(val) yield valueM1.8.1 *Method of the static String object. setUTCHours(val) setUTCMinutes(val) while (condition) { setUTCSeconds(val) statements Regular Expressions 42 setUTCMilliseconds(val) } getTimezoneOffset() global compile(regexp) toDateString() return [value] ignoreCase exec("string")* toGMTString() input test("string") toLocaleDateString() switch (expression) { lastIndex str.match(regexp) toLocaleString() case labelN : multiline str.replace(regexp,"string") toLocaleTimeString() statements lastMatch str.search(regexp) toString() [break] lastParen str.split(regexp[,limit]) toTimeString() ... leftContext toUTCString() [default : prototype UTC(dateValues)* statements] rightContext *Method of the static Date object. } source $1...$9 label : continue [label] *Returns array with properties: index, input, [0],...[n]. * 29 Math break [label] E abs(val) try { 31 LN2 acos(val) Array LN10 asin(val) statements to test constructor concat(array2) LOG2E atan(val) } length every(func[, thisObj])M1.8 LOG10E atan2(val1, val2) catch (errorInfo) { prototype filter(func[, thisObj])M1.8 PI ceil(val) statements if exception occurs in try block forEach(func[, thisObj])M1.8 SQRT1_2 cos(val) } indexOf(func[, thisObj])M1.8 SQRT2 exp(val) [finally { join("char") floor(val) statements to run, exception or not lastIndexOf(func[, thisObj])M1.8 log(val) }] map(func[, thisObj])M1.8 max(val1, val2) pop() min(val1, val2) throw value push() pow(val1, power) reverse() random() shift() round(val) slice(i,[j]) sin(val) 29 some(func[, thisObj])M1.8 sqrt(val) Number sort(compareFunc) tan(val) constructor toExponential(n) splice(i,j[,items]) *All properties and methods are of the static Math object. MAX_VALUE toFixed(n) toLocaleString() MIN_VALUE toLocaleString() toString() NaN toString([radix]) unshift() Error 32 NEGATIVE_INFINITY toPrecision(n) POSITIVE_INFINITY valueOf() prototype toString() prototype Function 34 constructor descriptionE arguments apply(this, argsArray) fileNameE caller call(this[,arg1[,...argN]]) lineNumber Boolean 29 constructor toString() message length valueOf() name constructor toString() prototype numberE prototype valueOf() 3 JavaScript Bible, 6th Edition. ©2007 Danny Goodman (dannyg.com). All Rights Reserved. JavaScript and Browser Objects Quick Reference Globals 35 Appendix A Functions atob()M JavaScript Bible, 6th Edition btoa()M decodeURI("encodedURI") by Danny Goodman decodeURIComponent("encComp") encodeURI("URIString") encodeURIComponent("compString") escape("string" [,1]) How to Use This Quick Reference eval("string") isFinite(number) This guide contains quick reference info for the Each term is supported by all baseline browsers unless isNaN(expression) core JavaScript language and browser object noted with a superscript symbol indicating browser brand isXMLName("string")M1.8.1 models starting with IE 5.5, Mozilla, and Safari. and version: Number("string") parseFloat("string") E—Internet Explorer M—Mozilla S—Safari Statements Numbers in the upper right corners of object For example, M1.4 means the term is supported only parseInt("string" [,radix]) // /*...*/ toString([radix]) const squares are chapter numbers in which the object by Mozilla 1.4 or later; E means the terms is supported unescape("string") var is covered in detail. only by Internet Explorer. unwatch(prop) watch(prop, handler) Operators 33 frameset 16 window 16 Comparison border (None) onload appCoreM addEventListener(”evt”, func,capt)MS onabortM == Equals borderColorE clientInformationES1.2 alert(”msg”) onafterprintE === Strictly equals cols clipboardDataE attachEvent(”evt”, func)E onbeforeprintE != Does not equal frameBorderE closed back()M onbeforeunloadE !== Strictly does not equal frameSpacingE Components[]M blur() onblur > Is greater than rows contentM clearInterval(ID) onclick >= Is greater than or equal to controllers[]M clearTimeout(ID) onclose < Is less than cryptoM close() onerror <= Is less than or equal to iframe 16 frame 16 defaultStatus confirm(”msg”) onfocus dialogArgumentsE createPopup()E onhelpE Arithmetic E align allowTransparency dialogHeightE detachEvent(”evt”, func)E onkeydown + Plus (and string concat.) E E allowTransparency borderColor dialogLeftE dispatchEvent()MS onkeypress - Minus MS MS contentDocument contentDocument dialogTopE dump(”msg”)M1.4 onkeyup * Multiply EM EM contentWindow contentWindow dialogWidthE execScript(”exprList”[, lang])E onload / Divide E frameBorder frameBorder directoriesM find([”str”[, case[, up]])M onmousedown % Modulo E E frameSpacing height document fireEvent(”evt”[, evtObj])E onmousemove ++ Increment height longDesc eventES focus() onmouseout -- Decrement E hspace marginHeight externalE forward()M onmouseover -val Negation longDesc marginWidth frameElementEMS1.2 geckoActiveXObject(ID)M1.4 onmouseup marginHeight name frames[] getComputedStyle(node, “”)M onmove Assignment marginWidth noResize fullScreenM1.4 getSelection()MS onreset = Equals name scrolling history home()M onresizeEM += Add by value noResize src innerHeightMS moveBy(Δx, Δy) onscrollEMS1.3 -= Subtract by value E scrolling width innerWidthMS moveTo(x, y) onunload *= Multiply by value src length navigate(”url”)E /= Divide by value E vspace location open(”url”, “name”[, specs]) %= Modulo by value width locationbarM openDialog(”url”, “name”[, specs])M <<= Left shift by value menubarM print() >>= Right shift by value name prompt(”msg”, ”reply”) >>>= Zero fill by value E navigator removeEventListener(”evt”, func,capt)MS &= Bitwise AND by value popup 16 netscapeM resizeBy(Δx, Δy) |= Bitwise OR by value document hide() offscreenBufferingES1.2 resizeTo(width, height) ^= Bitwise XOR by value isOpen show() opener scroll() outerHeightMS scrollBy(Δx, Δy) Boolean outerWidthMS scrollByLines(n)M && AND pageXOffsetMS scrollByPages(n)M || OR pageYOffsetMS scrollTo(x, y) ! NOT parent setInterval(func, msecs[, args]) personalbarM setTimeout(func, msecs[, args]) Bitwise pkcs11M showHelp(”url”)E & Bitwise AND prompterM showModalDialog(”url”[, args][, features])ES2.01 | Bitwise OR returnValueE showModelessDialog(”url”[, args][, features])E ^ Bitwise XOR location 17 screen sizeToContent()M ~ Bitwise NOT assign("url") screenLeftES1.2 stop()M << Left shift hash reload([unconditional]) screenTopES1.2 >> Right shift host replace(”url”) screenXMS1.2 >>> Zero fill right shift hostname href screenYMS1.2 scrollbarsM Miscellaneous pathname scrollMaxXM1.4 , Series delimiter port scrollMaxYM1.4 delete Property destroyer protocol scrollXMS in Item in object search scrollYMS instanceof Instance of self new Object creator sidebarM this Object self-reference history 17 status typeof Value type currentM(signed) back() statusbarM void Return no value length forward() toolbarM nextM(signed) go(int | "url") top previousM(signed) window 4 JavaScript Bible, 6th Edition. ©2007 Danny Goodman (dannyg.com). All Rights Reserved. JavaScript and Browser Objects Quick Reference document 18 All HTML Element Objects 15 activeElementE clear() onselectionchangeE accessKey addBehavior(”url”)E onactivateE alinkColor close() onstopE all[]E addEventListener(”evt”, func,capt)MS onafterupdateE anchors[] createAttribute(”name”)E6MS attributes[] appendChild(node) onbeforecopyES1.3 applets[] createCDATASection(”data”)M baseURIM applyElement(elem[, type])E onbeforecutES1.3 baseURIM createComment(”text”)E6MS behaviorUrns[]E attachEvent(”evt”, func)E onbeforedeactivateE bgColor createDocumentFragment()E6MS canHaveChildrenE blur() onbeforeeditfocusE body createElement(”tagname”) canHaveHTMLE clearAttributes()E onbeforepasteES1.3 charsetE createElementNS(”uri”, “tagname) childNodes[] click() onbeforeupdateE characterSetM createEvent(”evtType”)MS childrenES1.2 cloneNode(deep) onblur compatModeEM createEventObject([evtObj])E citeE6MS compareDocumentPosition(node)M1.4 oncellchangeE contentTypeM createNSResolver(nodeResolver)M className componentFromPoint(x, y)E onclick
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages8 Page
-
File Size-