?? javascript小技巧 - dooit - 博客園.htm
字號(hào):
?<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0057)http://www.cnblogs.com/ttyp/archive/2004/11/15/63900.html -->
<HTML><HEAD id=Head><TITLE>javascript小技巧 - DooIT - 博客園</TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META id=metaKeywords content=javascript小技巧 name=keywords>
<META
content=事件源對(duì)象event.srcElement.tagNameevent.srcElement.type捕獲釋放event.srcElement.setCapture();event.srcElement.releaseCapture();事件按鍵eve
name=description><LINK id=CommondCss
href="javascript小技巧 - DooIT - 博客園.files/common.css" type=text/css
rel=stylesheet><LINK id=MainCss
href="javascript小技巧 - DooIT - 博客園.files/style.css" type=text/css
rel=stylesheet><LINK id=SecondaryCss
href="javascript小技巧 - DooIT - 博客園.files/customcss.css" type=text/css
rel=stylesheet><LINK id=RSSLink title=RSS href="http://www.cnblogs.com/ttyp/rss"
type=application/rss+xml rel=alternate>
<SCRIPT src="javascript小技巧 - DooIT - 博客園.files/common.js"
type=text/javascript></SCRIPT>
<META content="MSHTML 6.00.2900.3395" name=GENERATOR></HEAD>
<BODY>
<FORM id=Form1 name=Form1 onsubmit="javascript:return WebForm_OnSubmit();"
action=63900.html method=post>
<DIV><INPUT id=__EVENTTARGET type=hidden name=__EVENTTARGET> <INPUT
id=__EVENTARGUMENT type=hidden name=__EVENTARGUMENT> <INPUT
id=" __VIEWSTATE" type=hidden name=__VIEWSTATE> </DIV>
<SCRIPT type=text/javascript>
//<![CDATA[
var theForm = document.forms['Form1'];
if (!theForm) {
theForm = document.Form1;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
//]]>
</SCRIPT>
<SCRIPT src="javascript小技巧 - DooIT - 博客園.files/WebResource.axd"
type=text/javascript></SCRIPT>
<SCRIPT language=JavaScript>
function ctlent(evt,id)
{
if(evt.ctrlKey && evt.keyCode == 13)
{
try
{
TempSave(id);
}
catch(ex)
{
}
finally
{
__doPostBack('AjaxHolder$PostComment$btnSubmit','')
}
}
}</SCRIPT>
<SCRIPT language=JavaScript>function SetReplyAuhor(author){document.getElementById('AjaxHolder_PostComment_tbComment').value+="@"+author+"\n";document.getElementById('AjaxHolder_PostComment_tbComment').focus();return false}</SCRIPT>
<SCRIPT src="javascript小技巧 - DooIT - 博客園.files/ScriptResource.axd"
type=text/javascript></SCRIPT>
<SCRIPT
src="D:\Backup\我的文檔\新建文件夾\javascript小技巧 - DooIT - 博客園.files\ScriptResource(1).axd"
type=text/javascript></SCRIPT>
<SCRIPT
src="D:\Backup\我的文檔\新建文件夾\javascript小技巧 - DooIT - 博客園.files\ScriptResource(2).axd"
type=text/javascript></SCRIPT>
<SCRIPT src="javascript小技巧 - DooIT - 博客園.files/js"
type=text/javascript></SCRIPT>
<SCRIPT type=text/javascript>
//<![CDATA[
function WebForm_OnSubmit() {
if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) return false;
return true;
}
//]]>
</SCRIPT>
<DIV id=top>
<DIV>
<TABLE>
<TBODY>
<TR>
<TD class=HeaderTitles>
<H1 class=HeaderTitle><A class=HeaderMainTitle id=Header1_HeaderTitle
href="http://www.cnblogs.com/ttyp/">DooIT</A></H1>
<P id=tagline></P></TD></TR></TBODY></TABLE></DIV>
<DIV class=HeaderBar>
<TABLE class=HeaderBar id=HeaderBar cellSpacing=0 cellPadding=0>
<TBODY>
<TR>
<TD class=HeaderBarTab noWrap> <A id=Header1_MyLinks1_HomeLink
href="http://www.cnblogs.com/">博客園</A> :: <A
id=Header1_MyLinks1_MyHomeLink
href="http://www.cnblogs.com/ttyp/">首頁</A> :: <A
id=Header1_MyLinks1_NewPostLink
href="http://www.cnblogs.com/ttyp/admin/EditPosts.aspx?opt=1">新隨筆</A> ::
<A id=Header1_MyLinks1_ContactLink accessKey=9
href="http://www.cnblogs.com/ttyp/contact.aspx?id=1">聯(lián)系</A> :: <A
id=Header1_MyLinks1_Syndication
href="http://www.cnblogs.com/ttyp/rss">訂閱</A> <A class=XMLLink
id=Header1_MyLinks1_XMLLink href="http://www.cnblogs.com/ttyp/rss"><IMG
style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px"
alt=訂閱 src="javascript小技巧 - DooIT - 博客園.files/xml.gif"></A> :: <A
id=Header1_MyLinks1_Admin
href="http://www.cnblogs.com/ttyp/admin/EditPosts.aspx">管理</A> :: </TD>
<TD><IMG id=Header1_BlueTab
style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px"
src="javascript小技巧 - DooIT - 博客園.files/BlueTabRight.gif"
align=absMiddle></TD>
<TD class=HeaderBarTabBack noWrap width="100%">
<DIV class=BlogStatsBar>
<TABLE class=BlogStatsBar>
<TBODY>
<TR>
<TD width="100%"></TD>
<TD class=BlogStatsBar noWrap> 47 隨筆 :: 16 文章 :: 1364 評(píng)論
:: 25 Trackbacks
</TD></TR></TBODY></TABLE></DIV></TD></TR></TBODY></TABLE></DIV></DIV>
<DIV id=leftmenu></DIV>
<DIV id=main>
<SCRIPT type=text/javascript>
//<![CDATA[
Sys.WebForms.PageRequestManager._initialize('AjaxHolder$scriptmanager1', document.getElementById('Form1'));
Sys.WebForms.PageRequestManager.getInstance()._updateControls(['tAjaxHolder$UpdatePanel1'], [], [], 90);
//]]>
</SCRIPT>
<DIV class=post>
<DIV class=postTitle><A id=AjaxHolder_ctl01_TitleUrl
href="http://www.cnblogs.com/ttyp/archive/2004/11/15/63900.html">javascript小技巧</A>
</DIV>
<DIV class=postText>
<UL>
<LI><FONT size=2><STRONG>事件源對(duì)象</STRONG> <BR>event.srcElement.tagName
<BR>event.srcElement.type</FONT>
<LI><FONT size=2><STRONG>捕獲釋放
<BR></STRONG>event.srcElement.setCapture();
<BR>event.srcElement.releaseCapture(); </FONT>
<LI><FONT size=2><STRONG>事件按鍵</STRONG> <BR>event.keyCode <BR>event.shiftKey
<BR>event.altKey <BR>event.ctrlKey</FONT>
<LI><FONT size=2><STRONG>事件返回值</STRONG> <BR>event.returnValue</FONT>
<LI><FONT size=2><STRONG>鼠標(biāo)位置 <BR></STRONG>event.x <BR>event.y</FONT>
<LI><FONT size=2><STRONG>窗體活動(dòng)元素 <BR></STRONG>document.activeElement</FONT>
<LI><FONT size=2><STRONG>綁定事件</STRONG>
<BR>document.captureEvents(Event.KEYDOWN);</FONT>
<LI><FONT size=2><STRONG>訪問窗體元素 <BR></STRONG>document.all("txt").focus();
<BR>document.all("txt").select();</FONT>
<LI><FONT size=2><STRONG>窗體命令</STRONG> <BR>document.execCommand</FONT>
<LI><FONT size=2><STRONG>窗體COOKIE <BR></STRONG>document.cookie</FONT>
<LI><FONT size=2><STRONG>菜單事件</STRONG> <BR>document.oncontextmenu</FONT>
<LI><FONT size=2><STRONG>創(chuàng)建元素
<BR></STRONG>document.createElement("SPAN"); </FONT>
<LI><FONT size=2><STRONG>根據(jù)鼠標(biāo)獲得元素:
<BR></STRONG>document.elementFromPoint(event.x,event.y).tagName=="TD
<BR></FONT><FONT
size=2>document.elementFromPoint(event.x,event.y).appendChild(ms)
</FONT>
<LI><FONT size=2><STRONG>窗體圖片</STRONG> <BR>document.images[索引]</FONT>
<LI><FONT size=2><STRONG>窗體事件綁定
<BR></STRONG>document.onmousedown=scrollwindow;</FONT>
<LI><FONT size=2><STRONG>元素</STRONG> <BR>document.窗體.elements[索引]</FONT>
<LI><FONT size=2><STRONG>對(duì)象綁定事件
<BR></STRONG>document.all.xxx.detachEvent('onclick',a);</FONT>
<LI><FONT size=2><STRONG>插件數(shù)目</STRONG> <BR>navigator.plugins</FONT>
<LI><FONT size=2><STRONG>取變量類型 <BR></STRONG>typeof($js_libpath) ==
"undefined"</FONT>
<LI><FONT size=2><STRONG>下拉框 <BR></STRONG></FONT><FONT size=2>下拉框.options[索引]
<BR>下拉框.options.length</FONT>
<LI><FONT size=2><STRONG>查找對(duì)象</STRONG> <BR>document.getElementsByName("r1");
<BR>document.getElementById(id); </FONT>
<LI><FONT size=2><STRONG>定時(shí)
<BR></STRONG>timer=setInterval('scrollwindow()',delay);
<BR>clearInterval(timer);</FONT>
<LI><FONT size=2><STRONG>UNCODE編碼 <BR></STRONG>escape() ,unescape</FONT>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -