JAvascriptテクニック(一)



      
event.srcElement.tagName 
event.srcElement.type 
     
event.srcElement.setCapture();  
event.srcElement.releaseCapture();   
     
event.keyCode 
event.shiftKey 
event.altKey 
event.ctrlKey 
      
event.returnValue 
     
event.x 
event.y 
       
document.activeElement 
     
document.captureEvents(Event.KEYDOWN); 
       
document.all("txt").focus(); 
document.all("txt").select(); 
     
document.execCommand 
  COOKIE 
document.cookie 
     
document.oncontextmenu 
     
document.createElement("SPAN");   
        : 
document.elementFromPoint(event.x,event.y).tagName=="TD 
document.elementFromPoint(event.x,event.y).appendChild(ms)   
     
document.images[  ] 
       
document.onmousedown=scrollwindow; 
   
document.  .elements[  ] 
       
document.all.xxx.detachEvent('onclick',a); 
     
navigator.plugins 
      
typeof($js_libpath) == "undefined" 
    
   .options[  ] 
   .options.length 
     
document.getElementsByName("r1"); 
document.getElementById(id); 
   
timer=setInterval('scrollwindow()',delay); 
clearInterval(timer); 
UNCODE   
escape() ,unescape 
    
obj.parentElement(dhtml) 
obj.parentNode(dom) 
      
TableID.moveRow(2,1) 
  CSS 
document.all.csss.href = "a.css"; 
     
display:inline 
     
hidefocus=true 
       
style="word-break:break-all" 
     
<meta HTTP-EQUIV="refresh" CONTENT="8;URL=http://c98.yeah.net"> 
     
<a   href="mailto:[email protected]?subject=ccc&body=xxxyyy">   
       
obj.scrollIntoView(true) 
  
<a name="first"> 
<a href="#first">anchors</a> 
       
location.search(); 
    
obj.contenteditable=true 
       
obj.execCommand 
      
/[^\x00-\xff]/ 
   
/[\u4e00-\u9fa5]/ 
                 
word-wrap: break-word; word-break: break-all; 
     
<IFRAME src="1.htm" width=300 height=180 allowtransparency></iframe> 
  style   
obj.style.cssText 
HTML   
document.documentElement.innerHTML 
   style   
document.styleSheets[0] 
style          
document.styleSheets[0].rules[0] 
        ,          。 
<a href="javascript:function()">word</a> 
      
asp: 
request.servervariables("HTTP_REFERER") 
javascript: 
document.referrer 
     
CollectGarbage(); 
     
document.oncontextmenu = function() { return false;} 
     
<noscript><iframe src="*.htm"></iframe></noscript> 
    <body oncontextmenu="return false" ondragstart="return false" onselectstart ="return false" onselect="document.selection.empty()" oncopy="document.selection.empty()" onbeforecopy="return false"onmouseup="document.selection.empty()> 
     
<input type=text onpaste="return false"> 
      
<link rel="Shortcut Icon" href="favicon.ico"> 
favicon.ico       16*16 16 ,          
      
<link rel="Bookmark" href="favicon.ico"> 
     
<input type=button value=        onclick="window.location = 'view-source:'+ 'http://www.csdn.net/'"> 
      
<input style="ime-mode:disabled"> 
     
<input type=text name=text1 value="123" onfocus="this.select()"> 
ENTER               
<input onkeydown="if(event.keyCode==13)event.keyCode=9"> 
        
<input type=text value="123" onfocus="alert(this.defaultValue)"> 
title   
obj.title = "123&#13sdfs&#32" 
           
var n1 = new Date("2004-10-10".replace(/-/g, "\/")).getTime() 
       
win.closed 
checkbox   
<input type=checkbox style="position: absolute; clip:rect(5px 15px 15px 5px)"><br> 
       
document.selection.createRange().duplicate().text 
       
<input   type=text   autocomplete=on>       
<input   type=text   autocomplete=off>          
      
<body onload="window.resizeTo(window.screen.width - 4,window.screen.height-50);window.moveTo(-4,-4)"> 
     IE 
window.open("aa.htm", "meizz", "fullscreen=7"); 
    /   
alert(decodeURIComponent(encodeURIComponent("http://  .com?as= hehe"))) 
encodeURIComponent ":"、"/"、";"   "?"    
      
<tr onmouseover="this.bgColor='#f0f0f0'" onmouseout="this.bgColor='#ffffff'">