JavascriptÖÐ×î³£ÓõÄ55¸ö¾µä¼¼ÇÉ
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 language="javascript">
function cc()
{
var e = event.srcElement;
var r =e.createTextRange();
r.moveStart
Ïà¹ØÎĵµ£º
ÉùÃ÷£º
function person(name, country)
{
this.name = name;
this.country = country;
}
ʵÀý»¯¶ÔÏó£º
var theauthor = new person('Daniel', 'U.S.A.');
ÒýÓãº
function sayHello(objPerson)
{
return "Hello " + objPerson. ......
Ò»£¬javascriptµÄÁ÷³Ì¿ØÖÆÓï¾ä
if(x==null) »ò if(typeof(x) =='undefined')¿ÉÒÔ¼òµ¥Ð´if(!x)
×¢Ò⣺ÔÚjavascriptÖУ¬false,null,undefined,0,""¾ùÊÇfalse
¼´ var x;
´Ëʱ if(x==null)
if(typeof(x)=='undefined')¾ùΪÕæ
¶þ£¬switchÓï¾ä
switch(±í´ïʽ)   ......
½ñÌìżȻ¿´µ½ÁËconstructorÕâ¸ö¶«¶«£¬²»Ã÷°×ÓÃ;¡£Õҵ㶫Î÷±¸Íü
typeofº¯ÊýµÄÓ÷¨¿ÉÄܲ»ÓÃÎÒ¶à˵£¬´ó¼Ò¶¼ÖªµÀÔõôÓ᣶øconstructorÊôÐÔ´ó¼Ò¿ÉÄܾÍÄ°Éúµã¡£ÔÚ¡¶¾«Í¨JavaScript¡·Õâ±¾ÊéÖÐÓÐÌáµ½constructµÄÓ÷¨£¬µ«ÎÒÓÃ×Ô¼ºµÄ¼¸¸öä¯ÀÀÆ÷£¨IE7.0 / Firefox1.9 / Opera9.50£©²âÊԵĽá¹ûÈ´ºÍÊéÉÏ˵µÄ²»Ò»Ñù¡£µ«ÊÇÈÔÈ»ÊÇÓÐ°ì·¨Í ......
JavaScriptºÍJavaµÄÇø±ð
¡¡¡¡ËäÈ»JavaScriptÓëJavaÓнôÃܵÄÁªÏµ£¬µ«È´ÊÇÁ½¸ö¹«Ë¾¿ª·¢µÄ²»Í¬µÄÁ½¸ö²úÆ·¡£JavaÊÇSUN¹«Ë¾ÍƳöµÄÐÂÒ»´úÃæÏò¶ÔÏóµÄ³ÌÐòÉè¼ÆÓïÑÔ£¬ÌرðÊʺÏÓÚInternetÓ¦ÓóÌÐò¿ª·¢£»¶øJavaScriptÊÇNetscape¹«Ë¾µÄ²úÆ·£¬ÆäÄ¿µÄÊÇΪÁËÀ©Õ¹Netscape Navigator¹¦ÄÜ,¶ø¿ª·¢µÄÒ»ÖÖ¿ÉÒÔǶÈëWebÒ³ÃæÖеĻùÓÚ¶ÔÏóºÍʼþÇý¶ ......
Ò»£¬È«¾Ö±äÁ¿ºÍ¾Ö²¿±äÁ¿µÄ±È½Ï
<script type="text/javascript">
<!--
var msg = 'È«¾Ö±äÁ¿';
function show()
{
msg = '¾Ö²¿±äÁ¿'; //ÐÞ¸ÄÈ«¾Ö±äÁ¿µÄÖµ
}
show();
alert(msg); //´ËʱµÄֵΪ‘¾Ö²¿±äÁ¿’
//-->
</script> <script type="text/javascript" ......