четверг, 6 июня 2013 г.

JavaScript Подсказка по командам



Boolean

true.constructor;
true.prototype;

true.toString();
true.valueOf();
Number

(100).constructor;
Number.prototype;

(100).toString([radix]);
(100).valueOf();
(100).toFixed(n);

(100).toLocaleString();
(100).toExponential(n);
(100).toPrecision(n);

Number.MAX_VALUE;
Number.MIN_VALUE;
Number.NaN;
Number.NEGATIVE_INFINITY;
Number.POSITIVE_INFINITY;


String

"str".constructor;
"str".prototype;

"str".toString();
"str".valueOf();

"str".length;

"str".indexOf("str" [,i]);
"str".lastIndexOf("str" [,i]);

"str".charAt(index);
"str".charCodeAt([i]);

"str".fromCharCode(n1...);

"str".substr(start,length);
"str".substring(intA, intB);

"str".slice(i,j);
"str".split(char);
"str".replace(regexp,str);

"str".concat(string2);

"str".search(regexp);
"str".match(regexp);

"str".toLowerCase();
"str".toUpperCase();
"str".toLocaleLowerCase();
"str".toLocaleUpperCase();

"str".anchor("anchorName");
"str".big();
"str".blink();
"str".bold();
"str".fixed();
"str".fontcolor(#rrggbb);
"str".fontsize(1to7);
"str".italics();
"str".link(url);
"str".localeCompare();
"str".small();
"str".strike();
"str".sub();
"str".sup();

Array

[1,2,3].constructor;
[1,2,3].prototype;

[1,2,3].toString();
[1,2,3].toLocaleString();

[1,2,3].length;

[1,2,3].indexOf(func[, thisObj]);
[1,2,3].lastIndexOf(func[, thisObj]);

[1,2,3].push();
[1,2,3].pop();

[1,2,3].shift();
[1,2,3].unshift();

[1,2,3].join("char");

[1,2,3].sort(compareFunc);
[1,2,3].reverse();

function sortFunction(a, b){
  if(a < b){
     return -1;
  } else if(a > b) {
     return 1;
  } else {
    return 0;
  }
}

[1,2,3].slice(i,[j]);
[1,2,3].splice(i,j[,items]);

[1,2,3].concat(array2);

[1,2,3].filter(func[, thisObj]);

[1,2,3].every(func[, thisObj]);

[1,2,3].forEach(func[, thisObj]);

[1,2,3].some(func[, thisObj]);

[1,2,3].map(func[, thisObj]);






Date

new Date().constructor;
new Date().prototype;

new Date().getFullYear();
new Date().getYear();
new Date().getMonth();
new Date().getDate();
new Date().getDay();
new Date().getHours();
new Date().getMinutes();
new Date().getSeconds();
new Date().getTime();
new Date().getMilliseconds();
new Date().getUTCFullYear();
new Date().getUTCMonth();
new Date().getUTCDate();
new Date().getUTCDay();
new Date().getUTCHours();
new Date().getUTCMinutes();
new Date().getUTCSeconds();
new Date().getUTCMilliseconds();
new Date().getTimezoneOffset();

new Date().parse("dateString");

new Date().setYear(val);
new Date().setFullYear(val);
new Date().setMonth(val);
new Date().setDate(val);
new Date().setDay(val);
new Date().setHours(val);
new Date().setMinutes(val);
new Date().setSeconds(val);
new Date().setMilliseconds(val);
new Date().setTime(val);
new Date().setUTCFullYear(val);
new Date().setUTCMonth(val);
new Date().setUTCDate(val);
new Date().setUTCDay(val);
new Date().setUTCHours(val);
new Date().setUTCMinutes(val);
new Date().setUTCSeconds(val);
new Date().setUTCMilliseconds(val);

new Date().toString();
new Date().toDateString();
new Date().toGMTString();
new Date().toLocaleDateString();
new Date().toLocaleString();
new Date().toLocaleTimeString();
new Date().toTimeString();
new Date().toUTCString();
new Date().UTC(dateValues);

















































Globals

Statements
// /*...*/
const
var

Functions

eval("string");

toString([radix]);
Number("string");

parseInt("string" [,radix]);
parseFloat("string");

escape("string" [,1]);
unescape("string");

decodeURI("encodedURI");
encodeURI("URIString");

decodeURIComponent("encComp");
encodeURIComponent("compString");

watch(prop, handler);
unwatch(prop);

isFinite(number);
isNaN(expression);
isXMLName("string");

atob();
btoa();
Math


Math.random();

Math.floor(val);
Math.round(val);
Math.ceil(val);

Math.abs(val);
Math.acos(val);
Math.asin(val);
Math.atan(val);
Math.atan2(val1, val2);
Math.cos(val);
Math.exp(val);
Math.log(val);
Math.max(val1, val2);
Math.min(val1, val2);
Math.pow(val1, power);
Math.sin(val);
Math.sqrt(val);
Math.tan(val);

Math.E;
Math.LN2;
Math.LN10;
Math.LOG2E;
Math.LOG10E;
Math.PI;
Math.SQRT1_2;
Math.SQRT2;

Regular Expressions

RegExp.prototype;

"str".search(regexp);
"str".match(regexp);
"str".split(regexp[,limit]);
"str".replace(regexp,"string");

test("string");
exec("string");
compile(regexp);

global
ignoreCase
input
lastIndex
multiline
lastMatch
lastParen
leftContext
rightContext
source
$1...$9






Error

Error.constructor;
Error.prototype;

Error.toString();

Error.name;
Error.message;

Error.description;
Error.number;

Error.fileName;
Error.lineNumber;


Function

func.constructor;
func.prototype;

func.toString();
func.valueOf();

func.arguments;
func.length;

func.caller;

func.apply(this, argsArray);
func.call(this[,arg1[,...argN]]);



 

Control Statements

if (condition) {
    statementsIfTrue
}

if (condition) {
    statementsIfTrue
} else {
    statementsIfFalse
}

result = condition ? expr1 : expr2

for ([init]; [condition]; [update]) {
    statements
}

for (var in object) {
    statements
}

for each ([var] varName in objectRef) {
    statements
}

with (objRef) {
    statements
}

do {
    statements
} while (condition)

yield value

while (condition) {
statements
}

return [value]

switch (expression) {
    case labelN :
                        statements
                        [break]
    ...
    [default :
                        statements]
}

label :
continue [label]
break [label]

try {
    statements to test
}
catch (errorInfo) {
    statements if exception occurs in try block
}
[finally {
    statements to run, exception or not
}]

throw value
Operators

Comparison
== Equals
=== Strictly equals
!= Does not equal
!== Strictly does not equal
> Is greater than
>= Is greater than or equal to
< Is less than
<= Is less than or equal to

Arithmetic
+ Plus (and string concat.)
- Minus
* Multiply
/ Divide
% Modulo
++ Increment
-- Decrement
-val Negation

Assignment
= Equals
+= Add by value
-= Subtract by value
*= Multiply by value
/= Divide by value
%= Modulo by value
<<= Left shift by value
>>= Right shift by value
>>>= Zero fill by value
&= Bitwise AND by value
|= Bitwise OR by value
^= Bitwise XOR by value

Boolean
&& AND
|| OR
! NOT

Bitwise
& Bitwise AND
| Bitwise OR
^ Bitwise XOR
~ Bitwise NOT
<< Left shift
>> Right shift
>>> Zero fill right shift

Miscellaneous

typeof        - Value type
instanceof - Instance of
in               - Item in object
this            - Object self-reference
new           - Object creator
delete        - Property destroyer
void           - Return no value
,                 - Series delimiter

Window

window
document
location
history
navigator

self
top
parent
opener

name

innerHeight
innerWidth

outerHeight
outerWidth

pageXOffset
pageYOffset

screen
screenLeft
screenTop
screenX
screenY

scrollbars
scrollMaxX
scrollMaxY
scrollX
scroll

event

appCore
clientInformation
clipboardData
closed
Components[]
content
controllers[]
crypto
defaultStatus
dialogArguments
dialogHeight
dialogLeft
dialogTop
dialogWidth
directories
external
frameElement
frames[]
locationbar
menubar
netscape
offscreenBuffering

fullScreen

length

personalbar
pkcs11
prompter

returnValue

sidebar
status
statusbar
toolbar
Window

alert(”msg”);
confirm(”msg”);
prompt(”msg”, ”reply”);
print();

attachEvent(”evt”, func);
addEventListener(”evt”, func,capt);
removeEventListener(”evt”, func,capt);
detachEvent(”evt”, func);
dispatchEvent();
fireEvent(”evt”[, evtObj]);

focus();
blur();

open(”url”, “name”[, specs]);
close();

stop();
home();
forward();
back();

moveBy(x, y);
moveTo(x, y);

scroll();
scrollBy(x, y);
scrollByLines(n);
scrollByPages(n);
scrollTo(x, y);

resizeBy(x, y);
resizeTo(width, height);
sizeToContent();

setInterval(func, msecs[, args]);
setTimeout(func, msecs[, args]);

clearInterval(ID);
clearTimeout(ID);

createPopup();

dump(”msg”);
execScript(”exprList”[, lang]);
find([”str”[, case[, up]]);
geckoActiveXObject(ID);
getComputedStyle(node, “”);
getSelection();

navigate(”url”);
openDialog(”url”, “name”[, specs]);

showHelp(”url”);
showModalDialog(”url”[, args][, features]);
showModelessDialog(”url”[, args][, features]);
Events

onload();
onunload();
onbeforeunload();
onabort();
onerror();

onafterprint();
onbeforeprint();

onfocus();
onblur();

onclick();

onkeydown();
onkeypress();
onkeyup();

onmousedown();
onmouseup();
onmousemove();
onmouseout();
onmouseover();

onmove();
onreset();
onresize();
onscroll();
onclose();

onhelp();






Location

location.hash;
location.host;
location.hostname;
location.href;
location.pathname;
location.port;
location.protocol;
location.search;

location.assign("url");
location.reload([unconditional]);
location.replace(”url”);
History

history.current;
history.length;
history.next;
history.previous;

history.back();
history.forward();
history.go(int | "url");
Popup

document;
isOpen;

hide();
show();
Iframe

align;
allowTransparency;
contentDocument;
contentWindow;
frameBorder;
frameSpacing;
height;
hspace;
longDesc;
marginHeight;
marginWidth;
name;
noResize;
scrolling;
src;
vspace;
width;
Frame

allowTransparency;
borderColor;
contentDocument;
contentWindow;
frameBorder;
height;
longDesc;
marginHeight;
marginWidth;
name;
noResize;
scrolling;
src;
width;


Document

activeElement
alinkColor
anchors[]
applets[]
baseURI
bgColor
body
charset
characterSet
compatMode
contentType
cookie
defaultCharset
defaultView
designMode
doctypeM
documentElement
documentURI
domain
embeds[]
expando
fgColor
fileCreatedDate
fileModifiedDate
fileSizeE
forms[]
frames[]
height
images[]
implementation
inputEncoding
lastModified
linkColor
links[]
location
media
mimeType
nameProp
namespaces[]
parentWindow
plugins[]
protocol
referrer
scripts[]
security
selection
strictErrorChecking
styleSheets[]
title
URL
URLUnencoded
vlinkColor
widthMS
xmlEncoding
xmlStandalone
xmlVersion
Document

document.write(”string”);
document.writeln(”string”);

document.getElementById(”ID”);
document.getElementsByName(”name”);

document.createElement(”tagname”);
document.createDocumentFragment();
document.createAttribute(”name”);
document.createComment(”text”);
document.createTextNode(”text”);
document.createStyleSheet([”url”[, index]])

document.createEvent(”evtType”);
document.createEventObject([evtObj]);

document.createRange();

open([”mimetype”][, “replace”])
close()
clear()


createCDATASection(”data”)
createElementNS(”uri”, “tagname)
createNSResolver(nodeResolver)
createTreeWalker(root, what, filterfunc, exp)

elementFromPoint(x, y)
evaluate(”expr”, node, resolver, type, result)

execCommand(”cmd”[, UI][, param])

importNode(node, deep)

queryCommandEnabled(”commandName”)
queryCommandIndterm(”commandName”)
queryCommandState(”commandName”)
queryCommandSupported(”commandName”)
queryCommandText(”commandName”)
queryCommandValue(”commandName”)

recalc([all])


Document

document.onselectionchange;
document.onstop;
Canvas

fillStyle
globalAlpha
globalCompositeOperation
lineCap
lineJoin
lineWidth
miterLimit
shadowBlur
shadowColor
shadowOffsetX
shadowOffsetY
strokeStyle
target

arc(x, y, radius, start, end, clockwise)
arcTo(x1, y1, x2, y2, radius)
bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y)
beginPath()
clearRect(x, y, width, height)
clip()
closePath()
createLinearGradient(x1, y1, x2, y2)
createPattern(img, repetition)
createRadialGradient(x1, y1, radius1, x2, y2, radius2)
drawImage(img, x, y)
drawImage(img, x, y, width, height)
fill()
fillRect(x, y, width, height)
getContext(contextID)
lineTo(x, y)
moveTo(x, y)
quadraticCurveTo(cpx, cpy, x, y)
rect(x, y, width, height)
restore()
rotate(angle)
save()
scale(x, y)
stroke()
strokeRect(x, y, width, height)
translate(x, y)
Frameset

border
borderColor
cols
frameBorder
frameSpacing
rows

onload
 

Range

collapsed
commonAncestorContainer

startContainer
startOffset

endContainer
endOffset

cloneContents()
cloneRange()

collapse([start])

compareBoundaryPoints(type,src)
compareNode(node)
comparePoint(node, offset)

createContextualFragment("text")
deleteContents()

detach()

extractContents()

insertNode(node)

intersectsNode(node)
isPointInRange(node, offoffsetset)

selectNode(node)
selectNodeContents(node)

setStart(node,offset)
setStartAfter(node)
setStartBefore(node)

setEnd(node,offset)
setEndAfter(node)
setEndBefore(node)

surroundContents(node)

toString()



TextRange

boundingHeight
boundingLeft
boundingTop
boundingWidth

htmlText

offsetLeft
offsetTop

text

collapse([start])
compareEndPoints("type",range)

duplicate()

execCommand("cmd"[,UI[,val]])
expand("unit")

findText("str"[,scope,flags])

getBookmark()
getBoundingClientRect()
getClientRects()

inRange(range)
isEqual(range)

move("unit"[,count])
moveEnd("unit"[,count])
moveStart("unit"[,count])
moveToBookmark("bookmark")
moveToElementText(elem)
moveToPoint(x,y)

parentElement()

pasteHTML("HTMLText")

queryCommandEnabled("cmd")
queryCommandIndeterm("cmd")
queryCommandState("cmd")
queryCommandSupported("cmd")
queryCommandText("cmd")
queryCommandValue("cmd")

scrollIntoView()

select()

setEndPoint("type",range)
Selection

anchorNode
anchorOffset

focusNode
focusOffset

isCollapsed

rangeCount
type
typeDetail

addRange(range)

clear()

collapse(node, offset)
collapseToEnd()
collapseToStart()

containsNode(node, entireFlag)

createRange()

deleteFromDocument()

empty()

extend(node, offset)

getRangeAt(rangeIndex)

removeAllRanges()
removeRange(range)

selectAllChildren(elementRef)

toString()
Select

form
length
multiple
name

options[]
options[i].defaultSelected
options[i].index
options[i].selected
options[i].text
options[i].value

selectedIndex

size
type
value

add(newOption[, index])
add(newOption, optionRef)

remove(index)

onchange
DOM

nodeName
nodeValue
nodeType
parentNode
childNodes
firstChild
lastChild
previousSibling
nextSibling
attributes  
ownerDocument

element.innerHTML = “”;
element.appendChild(para);
parent.removeChild(child);
























Screen

width
height

availWidth
availHeight

availLeft
availTop

bufferDepth

colorDepth

pixelDepth

fontSmoothingEnabled

updateInterval
Navigator

userAgent

userLanguage
browserLanguage
language

appCodeName
appMinorVersion
appName
appVersion

cookieEnabled

cpuClass
mimeTypes
onLine
oscpu
platform
plugins
product
productSub
securityPolicy
systemLanguage
userProfile
vendor
vendorSub

javaEnabled()
preference(name[, val]
XMLHttpRequest

readyState
responseText
responseXML
status
statusText

abort()
getAllResponseHeaders()
getResponseHeader(”headerName”)
open(”method”, “url”[, asyncFlag])
send(data)
setRequestHeader(”name”, “value”)

onreadystatechange
Input

checked(checkbox, radio)
complete(image)
defaultChecked(checkbox, radio)
defaultValue(text, password)
form
maxLength(text)
name
readOnly(text)
size(text)
src(image)
type
value

select()(text, password)

onchange(text)


Form

acceptCharset
action
autocomplete
elements[]
encoding
enctype
length
method
name
target

reset()
submit()

onreset
onsubmit

Img

align
alt
border
complete
dynsrc
fileCreatedDate
fileModifiedDate
fileSize
fileUpdatedDate
height
href
hspace
isMap
longDesc
loop
lowsrc
mimeType
name
nameProp
naturalHeight
naturalWidth
protocol
src
start
useMap
vspace
width
x
y

onabort
onerror
onload

Комментариев нет:

Отправить комментарий