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
Ïà¹ØÎĵµ£º
javascript ¿ØÖÆ htmlÔªËØ ÏÔʾ/Òþ²Ø
1¡£±àдjsº¯Êý
<script type="text/javascript">
function display(y){$(y).style.display=($(y).style.display=="none")?"":"none";}
function $(s){return document.getElementById(s);}
</script>
2. ÒªÏÔʾ/Òþ²ØµÄhtmlÔªËؼÓÉÏ id ÊôÐÔ
< ......
¶¨ÒåºÍÓ÷¨
eval() º¯Êý¿É¼ÆËãij¸ö×Ö·û´®£¬²¢Ö´ÐÐÆäÖÐµÄµÄ JavaScript ´úÂë¡£
Óï·¨
eval(string)
²ÎÊýÃèÊö
string
±ØÐè¡£Òª¼ÆËãµÄ×Ö·û´®£¬ÆäÖк¬ÓÐÒª¼ÆËãµÄ JavaScript ±í´ïʽ»òÒªÖ´ÐеÄÓï¾ä¡£
·µ»ØÖµ
ͨ¹ý¼ÆËã string µÃµ½µÄÖµ£¨Èç¹ûÓеĻ° ......
Òý×Ó
±à³ÌÊÀ½çÀïÖ»´æÔÚÁ½ÖÖ»ù±¾ÔªËØ£¬Ò»¸öÊÇÊý¾Ý£¬Ò»¸öÊÇ´úÂë¡£±à³ÌÊÀ½ç¾ÍÊÇÔÚÊý¾ÝºÍ´úÂëǧ˿ÍòÂƵľÀ²øÖгÊÏÖ³öÎÞÏÞµÄÉú»úºÍ»îÁ¦¡£
Êý¾ÝÌìÉú¾ÍÊÇÎľ²µÄ£¬×ÜÏë±£³Ö×Ô¼º¹ÌÓеı¾É«£»¶ø´úÂëÈ´ÌìÉú»îÆã¬×ÜÏë¸Ä±äÕâ¸öÊÀ½ç¡£
Äã¿´£¬Êý¾Ý´úÂë¼äµÄ¹ØϵÓëÎïÖÊÄÜÁ¿¼äµÄ¹Ø ......
43¡¢JavaScriptÖ÷Ò³µ¯³ö´°¿Ú¼¼ÇÉ
´°¿ÚÖм䵯³ö
<script>
window.open("http://www.cctv.com","","width=400,height=240,top="+(screen.availHeight-240)/2+",left="+(screen.availWidth-400)/2);
</script>
============
<html>
<head>
<script language="LiveScript">
fu ......
JavaScriptÔÊÐí´´½¨ºÍ´ò¿ª´ú±íHTMLÎı¾, form¶ÔÏóºÍframeµÄ´°¿Ú. window¶ÔÏóÊÇJavaScript¿Í»§²ã´Î½á¹¹µÄ×²ã¶ÔÏó, formÔªËغÍÈ«²¿JavaScript´úÂ붼ÊÇ´æÔÚÓÚÎĵµÖÐ,¶øÎĵµ±»×°Ôؽø´°¿Ú. ΪÁËÀí½â´°¿ÚÔõÑù¹¤×÷,Äã¿ÉÒÔ¿ØÖƲÙ×÷ÕâЩ´°¿Ú.
´ò¿ªºÍ¹Ø±Õ´°¿Ú
µ±Óû§Æô¶¯(launch)Navigatorʱ,½«×Ô¶¯´´½¨Ò»¸ö´°¿Ú.Óû§»¹¿ÉÒÔÊ¹Ó ......