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

JavascriptÖÐ×î³£ÓõÄ61¸ö¾­µä¼¼ÇÉ

 1. oncontextmenu="window.event.returnValue=false" ½«³¹µ×ÆÁ±ÎÊó±êÓÒ¼ü
<table border oncontextmenu=return(false)><td>no</table> ¿ÉÓÃÓÚTable
2. <body onselectstart="return false"> È¡ÏûÑ¡È¡¡¢·ÀÖ¹¸´ÖÆ
3. onpaste="return false" ²»×¼Õ³Ìù
4. oncopy="return false;" oncut="return false;" ·ÀÖ¹¸´ÖÆ
5. <link rel="Shortcut Icon" href="favicon.ico"> IEµØÖ·À¸Ç°»»³É×Ô¼ºµÄͼ±ê
6. <link rel="Bookmark" href="favicon.ico"> ¿ÉÒÔÔÚÊղؼÐÖÐÏÔʾ³öÄãµÄͼ±ê

7. <input style="ime-mode:disabled"> ¹Ø±ÕÊäÈë·¨

8. ÓÀÔ¶¶¼»á´ø×Å¿ò¼Ü
<script language="JavaScript"><!--
if (window == top)top.location.href = "frames.htm"; //frames.htmΪ¿ò¼ÜÍøÒ³
// --></script>

9. ·ÀÖ¹±»ÈËframe
<SCRIPT LANGUAGE=JAVASCRIPT><!--
if (top.location != self.location)top.location=self.location;
// --></SCRIPT>

10. ÍøÒ³½«²»Äܱ»Áí´æΪ
<noscript><*** src="/*.html>";</***></noscript>

11. <input type=button value="/²é¿´ÍøÒ³Ô´´úÂë
onclick="window.location = "view-source:"+ "http://www.pconline.com.cn"">
12.ɾ³ýʱȷÈÏ
<a href=""javascript :if(confirm("ȷʵҪɾ³ýÂð?"))location="boos.asp?&areyou=ɾ³ý&page=1"">ɾ³ý</a>

13. È¡µÃ¿Ø¼þµÄ¾ø¶ÔλÖÃ
//Javascript
<script language="Javascript">
function getIE(e){
var t=e.offsetTop;
var l=e.offsetLeft;
while(e=e.offsetParent){
t+=e.offsetTop;
l+=e.offsetLeft;
}
alert("top="+t+"/nleft="+l);
}
</script>
//VBScript
<script language="VBScript"><!--
function getIE()
dim t,l,a,b
set a=document.all.img1
t=document.all.img1.offsetTop
l=document.all.img1.offsetLeft
while a.tagName<>"BODY"
set a = a.offsetParent
t=t+a.offsetTop
l=l+a.offsetLeft
wend
msgbox "top="&t&chr(13)&"left="&l,64,"µÃµ½¿Ø¼þµÄλÖÃ"
end function
--></script>

14. ¹â±êÊÇÍ£ÔÚÎı¾¿òÎÄ×ÖµÄ×îºó
<script


Ïà¹ØÎĵµ£º

javascript µÄ scope myhere

// JavaScript ½Å±¾£¬½âÎöÐÍÓïÑÔ
//
var ABCD = function(){
var pub = {};
var pri = {};
pri.name = "myhere";
pri.age = 23;
//var ABCDE;
pub.setName = function( newName){
pri.name = newName;
};
// ÕâÀï pub.getName ±»¸³ÖµÎªÒ»¸öº¯Êý£¬¾ÍÊǶ¨ÒåÒ»¸öº¯Êý
// Õâ¸öº¯Êý²¢Ã»ÓÐÔËÐУ¬Õâ¸öº¯Êý ......

JavaScript toFixed() ·½·¨

±¾ÎÄת×Ô£ºhttp://www.w3school.com.cn/js/jsref_tofixed.asp
¶¨ÒåºÍÓ÷¨
toFixed() ·½·¨¿É°Ñ Number ËÄÉáÎåÈëΪָ¶¨Ð¡ÊýλÊýµÄÊý×Ö¡£
Óï·¨
NumberObject.toFixed(num) 
²ÎÊýnumÃèÊö±ØÐè¡£¹æ¶¨Ð¡ÊýµÄλÊý£¬ÊÇ 0 ~ 20 Ö®¼äµÄÖµ£¬°üÀ¨ 0 ºÍ 20£¬ÓÐЩʵÏÖ¿ÉÒÔÖ§³Ö¸ü´óµÄÊýÖµ·¶Î§¡£Èç¹ûÊ¡ÂÔÁ˸òÎÊý£¬½«Óà 0 ´úÌæ¡£
......

javascriptÀïµÄdocument.allÓ÷¨

1
¡¢Àí½âdocument.all
[]
¡¡¡¡´ÓIE4¿ªÊ¼IEµÄobject
model²ÅÔö¼ÓÁËdocument.all
[],À´¿´¿´document.all
[]µÄDescription:
Array
of all HTML tags in the document.Collection of all elements contained by the
object.
¡¡¡¡Ò²¾ÍÊÇ˵document.all
[]ÊÇÎĵµÖÐËùÓбêÇ©×é³ÉµÄÒ»¸öÊý×é±äÁ¿£¬°üÀ¨ÁËÎĵµ¶ÔÏóÖÐËùÓ ......

JavaScriptÉè¼ÆģʽµÄÒ»ÖÖÓÐȤµÄ·âװС¼¼ÇÉ

      javascriptÉè¼ÆģʽµÚÒ»ÕÅÓÐÒ»¸öÓÐȤµÄʵÏּ̳еķ½·¨£¬µ±È»javascript±¾ÖÊÉÏÊÇʵÏּ̳У¬»¹²»ÊǵäÐÍÒâÒåÉϵÄ"is-a"µÄÂß¼­¼Ì³Ð»òÕß˵ÊÇÓïÒå¼Ì³Ð¡£»ù±¾µÄ·½·¨¾ÍÊÇͨ¹ýfunctionµÄprototypeÊôÐÔ¡£
Ò»£¬ºÜ¼òµ¥µÄ·½·¨
<script type="text/javascript">
<!--
var Anim = function(){ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ