Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

javascript(JS)±íµ¥ÑéÖ¤´óÈ«

1:js ×Ö·û´®³¤¶ÈÏÞÖÆ¡¢ÅжÏ×Ö·û³¤¶È ¡¢jsÏÞÖÆÊäÈë¡¢ÏÞÖƲ»ÄÜÊäÈë¡¢textarea ³¤¶ÈÏÞÖÆ 
2.:jsÅжϺº×Ö¡¢ÅжÏÊÇ·ñºº×Ö ¡¢Ö»ÄÜÊäÈ뺺×Ö
3:jsÅжÏÊÇ·ñÊäÈëÓ¢ÎÄ¡¢Ö»ÄÜÊäÈëÓ¢ÎÄ
4:jsÖ»ÄÜÊäÈëÊý×Ö,ÅжÏÊý×Ö¡¢ÑéÖ¤Êý×Ö¡¢¼ì²âÊý×Ö¡¢ÅжÏÊÇ·ñΪÊý×Ö¡¢Ö»ÄÜÊäÈëÊý×Ö
5:Ö»ÄÜÊäÈëÓ¢ÎÄ×Ö·ûºÍÊý×Ö
6: js emailÑéÖ¤ ¡¢js ÅжÏemail ¡¢ÐÅÏä/ÓÊÏä¸ñʽÑéÖ¤
7:js×Ö·û¹ýÂË,ÆÁ±Î¹Ø¼ü×Ö
8:jsÃÜÂëÑéÖ¤¡¢ÅжÏÃÜÂë 
2.1: js ²»Îª¿Õ¡¢Îª¿Õ»ò²»ÊǶÔÏó ¡¢ÅжÏΪ¿Õ ¡¢Åжϲ»Îª¿Õ 
2.2:±È½ÏÁ½¸ö±íµ¥ÏîµÄÖµÊÇ·ñÏàͬ
2.3:±íµ¥Ö»ÄÜΪÊý×ÖºÍ"_",
2.4:±íµ¥ÏîÊäÈëÊýÖµ/³¤¶ÈÏÞ¶¨
2.5:ÖÐÎÄ/Ó¢ÎÄ/Êý×Ö/ÓʼþµØÖ·ºÏ·¨ÐÔÅжÏ
2.6:ÏÞ¶¨±íµ¥Ïî²»ÄÜÊäÈëµÄ×Ö·û
2.7±íµ¥µÄ×Ô·û¿ØÖÆ
2.8:formÎı¾ÓòµÄͨÓÃУÑ麯Êý
1. ³¤¶ÈÏÞÖÆ
<script>
function test() 
{
if(document.a.b.value.length>50)
{
alert("²»Äܳ¬¹ý50¸ö×Ö·û£¡");
document.a.b.focus();
return false;
}
}
</script>
<form name=a onsubmit="return test()">
<textarea name="b" cols="40" wrap="VIRTUAL" rows="6"></textarea>
<input type="submit" name="Submit" value="check">
</form> 
2. Ö»ÄÜÊǺº×Ö 
<input onkeyup="value="/oblog/value.replace(/[^\u4E00-\u9FA5]/g,’’)">
3." Ö»ÄÜÊÇÓ¢ÎÄ
<script language=javascript>
function onlyEng()
{
if(!(event.keyCode>=65&&event.keyCode<=90))
event.returnvalue=false;
}
</script>
<input onkeydown="onlyEng();">
4. Ö»ÄÜÊÇÊý×Ö
<script language=javascript>
function onlyNum()
{
if(!((event.keyCode>=48&&event.keyCode<=57)||(event.keyCode>=96&&event.keyCode<=105)))
//¿¼ÂÇС¼üÅÌÉϵÄÊý×Ö¼ü
event.returnvalue=false;
}
</script>
<input onkeydown="onlyNum();">
5. Ö»ÄÜÊÇÓ¢ÎÄ×Ö·ûºÍÊý×Ö
<input onkeyup="value="/oblog/value.replace(/[\W]/g,"’’) "
onbeforepaste="clipboard


Ïà¹ØÎĵµ£º

JavaScriptµ÷ÊÔ·½·¨Ö®Ò»

ʹÓÃtry{...}catch(){}  ·½Ê½£¬Àý×ÓÈçÏ£º
function showAlarm(strObject){
try{
svgElement = document.getElementById(strObject);
svgElement.setAttribute("visibility","visible");
setTimeout("hideAlarm()",3000);//3Ãëºó½áÊø±¨¾¯
}catch(ex){
alert("º¯ÊýshowAlarm()·¢ÉúÒì³££º"+ex.descrip ......

javascriptʵÓõÄN¸öСÀý×Ó

°æȨÉùÃ÷£ºÔ­´´×÷Æ·£¬ÔÊÐíתÔØ£¬×ªÔØʱÇëÎñ±ØÒÔ³¬Á´½ÓÐÎʽ±êÃ÷ÎÄÕ ԭʼ³ö´¦ ¡¢×÷ÕßÐÅÏ¢ºÍ±¾ÉùÃ÷¡£·ñÔò½«×·¾¿·¨ÂÉÔðÈΡ£http://gzycm520.blog.51cto.com/175220/36822
· Ê¼þÔ´¶ÔÏó event.srcElement.tagName event.srcElement.type
· ²¶»ñÊÍ·Å event.srcElement.setCapture();  ......

Javascript¿ª·¢Ö®jsѹËõƪ

YUI Compressor ѹËõ JavaScript µÄÄÚÈÝ°üÀ¨£º
ÒƳý×¢ÊÍ
ÒƳý¶îÍâµÄ¿Õ¸ñ
ϸ΢ÓÅ»¯
±êʶ·ûÌæ»»£¨Identifier Replacement£©
YUI Compressor °üÀ¨ÄÄЩϸ΢ÓÅ»¯ÄØ£¿
object["property"] £¬Èç¹ûÊôÐÔÃûÊǺϷ¨µÄ JavaScript ±êʶ·û£¨×¢£ººÏ·¨µÄ JavaScript ±êʶ·û——ÓÉÒ»¸ö×Öĸ¿ªÍ·£¬ÆäºóÑ¡ÔñÐԵؼÓÉÏÒ»¸ö»òÕ ......

javascript: The Browser Object Model(BOM)

window
window¶ÔÏóÊÇä¯ÀÀÆ÷»òÕß¿ò¼Ü×ÔÉí.top×ÜÊÇä¯ÀÀÆ÷,parentÊǸ¸¿ò¼Ü,self±íʾ×Ô¼º.
windowͨ³£¿ÉÒÔÊ¡ÂÔ.
´°¿Ú²Ù×÷: moveBy(dx, dy), moveTo(x, y),
resizeBy(dw, dh), resizeTo(w, h).
µ¼º½: window.open(url, frame
name, attribute). attribute¿ÉÒÔÊÇleft, top, height, width, resizable,
scrollable, too ......

javascript±äÁ¿×÷ÓÃÓò

±äÁ¿µÄ×÷ÓÃÓòÖ¸µÄÊDZäÁ¿µÄ¿É¼ûÐÔ£¬¶øÉúÃüÖÜÆÚÔò£¨´æ»îÆÚ£©ÔòÊÇ´ÓÁíÒ»¸ö½Ç¶È¿¼²ì±äÁ¿¡£ jsÖбäÁ¿µÄ×÷ÓÃÓò·ÖΪȫ¾Ö±äÁ¿ºÍ¾Ö²¿±äÁ¿£¬º¯ÊýÄÚ¶¨ÒåµÄ³ÆΪ¾Ö²¿±äÁ¿£¬º¯ÊýÍâµÄ³ÆΪȫ¾Ö±äÁ¿¡££¨¡°º¯ÊýÍâµÄ³ÆΪȫ¾Ö±äÁ¿¡±ÊÇÏà¶ÔµÄ£¬Áí´Ë´¦ÌÖÂÛµÄÇ°ÌáÊÇÓÃvarÏÔʽÉùÃ÷µÄ±äÁ¿£¬º¯ÊýÄÚ²»ÓÃvar¶¨ÒåµÄ±äÁ¿Ä¬ÈÏÊÇÈ«¾Ö±äÁ¿£¬µ±È»ºöÂÔvarÉùÃ÷± ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ