107個のよく使うjavascript文
4645 ワード
もっと読む
1.document.write("");
2.JS //
3. HTML :document->html->(head,body)
4. DOM :window->(navigator,screen,history,location,document)
5. :document.getElementById(" ID ").name( value)
6. JS: document.getElementById("output").value = document.getElementById("input").value.toUpperCase();
7.JS :String,Number,Boolean,Null,Object,Function
8.JS :parseInt(),parseFloat()
9.JS "" )
10.JS length)
11.JS .
12.JS :== ,!= ,>,>=,<. expression="" loop="" functionname="" var="" form="window.document.forms[0]" for="" i="0;" if="" form.elements.value="" mystring="new" string="" is="" lightsword="" today="new" date="">
49. JS:
50. HTML:
51. onCLICK , a.html, b.html.
:dfsadf
52.JS :Array,Boolean,Date,Error,EvalError,Function,Math,Number,Object,RangeError,ReferenceError,RegExp,
String,SyntaxError,TypeError,URIError
53.JS :
54. :function fullScreen(){ this.moveTo(0,0);this.outerWidth=screen.availWidth;
this.outerHeight=screen.availHeight;}window.maximize=fullScreen;
55.JS all
56.JS :document.getElementByid(" ").tabIndex = 1
57.innerHTML : "how are you"
, innerHTML :how are you
58.innerTEXT , .
59.contentEditable ,isContentEditable .
60.isDisabled .disabled
61.length ,
62.addBehavior() JS .htc
63.window.focus() .
64.blur() . FOCUS() .
65.select() .
66. nfocus="this.blur()"
67. :document.all.tags("div( HTML )").length
68.JS : .window.showModaldialog(),window.showModeless()
69. :window.status=' ', :window.defaultStatus = ' .';
70. :external.AddFavorite("http://www.dannyg.com";,"jaskdlf");
71.JS :window.onerror = doNothing; :window.onerror = handleError;
72.JS :window.opener, opener.opener... .
73.JS self
74.JS :window.status=" "
75.JS top
76.JS :window.close();
77.JS :if(confirm("Are you sure?")){alert("ok");}else{alert("Not Ok");}
78.JS :window.navigate("http://www.sina.com.cn";);
79.JS :window.print()
80.JS :window.prompt("message","defaultReply");
81.JS :window.scroll(x,y)
82.JS :window.scrollby
83.JS :setInterval("expr",msecDelay) setInterval(funcRef,msecDelay) setTimeout
84.JS IE4 , NN :showModalDialog("URL"[,arguments][,features]);
85.JS :function verifyClose(){event.returnValue="we really like you and hope you will stay longer.";}} window.=verifyClose;
86. nload()
87. nunload()
88.window.location : protocol(http,hostname(www.example.com),port(80),host(www.example.com:80),pathname("/a/a.html"),hash("#giantGizmo", ),href( )
89.window.location.reload() .
90.window.history.back() ,window.history.forward() ,window.history.go( , URL)
91.document.write() ,document.writeln()
92.document.body.noWrap=true; .
93. .charAt( ), .
94."abc".charCodeAt( ), ASCii .
95. :string.concat(string2), =
96. .indexOf(" ", ), ( 0 )
97.string.lastIndexOf(searchString[,startIndex]) .
98.string.match(regExpression), .
99.string.replace(regExpression,replaceString) .
100.string.split( ) .
101.string.substr(start[,length]) .
102.string.toLowerCase() .
103.string.toUpperCase() .
104.parseInt(string[,radix( )]) .
105.parseFloat(string[,radix]) .
106.isNaN( ): .
107. :const, :var