Javascript´úÂëÊղشóÈ«
Javascript´úÂëÊղشóÈ«
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><iframe src="/*.html>";</iframe></noscript>
11. <input type=button value=²é¿´ÍøÒ³Ô´´úÂë
onclick="window.location = `view-source:` http://www.51js.com/`";>
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.create
Ïà¹ØÎĵµ£º
DOM
Document Object Model
ÊDZí´ïʽXMLÎĵµµÄ³£¼û·½Ê½£¬DOM¸ø¿ª·¢ÕßÌṩÁËÒ»ÖÖ¶¨Î»XML²ã¼¶½á¹¹µÄÖ±¹Û·½·¨¡£
½âÎö²¢ä¯ÀÀDOMÎĵµµÄÓÐЧ·½·¨ÎÞÒÉÄܼò»¯JavaScriptµÄ¿ª·¢¡£
¹é¸ù½áµ×£¬JavaScriptÖоø´ó²Ù×÷¶¼ÊÇJavaScriptºÍÍøÒ³ÀﲻͬµÄHTMLÔªËØÖ®¼äµÄ½»»¥£¬¶øDOMÔòÊǼò»¯ÕâÒ»¹ý³ÌµÄ³öÉ«¹¤¾ß¡£
ÀýÈ磺
» ......
ÄãÖªµÀÊÀ½çÉÏÓжàÉÙÖÖä¯ÀÀÆ÷Â𣿳ýÁËÎÒÃÇÊìÖªµÄIE, Firefox, Opera, SafariËÄ´óä¯ÀÀÆ÷Ö®Í⣬ÊÀ½çÉÏ»¹Óнü°ÙÖÖä¯ÀÀÆ÷¡£
¼¸ÌìÇ°£¬ä¯ÀÀÆ÷¼Ò×åÓиյ®ÉúÁËһλСÍõ×Ó£¬¾ÍÊÇGoogleÍƳöµÄChromeä¯ÀÀÆ÷¡£ÓÉÓÚChrome³öÉúÃûÃÅ£¬¾¡¹ÜËû»¹ÊǸöС¼Ò»ï£¬Ã»ÓÐÈ˸ÒС¿´Ëû¡£ÒÔºó£¬ÔÛÃdz£Ëµä¯ÀÀÆ÷µÄ&ld ......
javascript»ñÈ¡selectµÄֵȫ½â
»ñÈ¡ÏÔʾµÄºº×Ö
document.getElementById("bigclass").options[window.document.getElementById("bigclass").selectedIndex].text
»ñÈ¡Êý¾Ý¿âÖеÄid
window.document.getElementById("bigclass").value
»ñÈ¡select×é·ÖÅäµÄË÷Òýid
window.document.getElementById("bigclass").selected ......
µ¹¼Æʱ¼ÆËã
<body>
<div id="countdown"></div>
<mce:script type="text/javascript"><!--
var i = 0;
(function(){
var hour, min, sec, text;
tmp = 12 * 60 * 60 - i;
hour = Math.floor(tmp / 3600);
tm ......