⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 javaeye技术网站.htm

📁 几个运用了DWR框架编写的AJAX代码,
💻 HTM
📖 第 1 页 / 共 5 页
字号:
  名字最好不变16*16的16色,放虚拟目录根目录下</FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  <LI><FONT size=2><STRONG>收藏栏图标</STRONG> <BR>&lt;link rel="Bookmark" 
  href="favicon.ico"&gt; </FONT>&nbsp;&nbsp;&nbsp;&nbsp; 
  <LI><FONT size=2><STRONG>查看源码</STRONG> <BR>&lt;input type=button value=查看网页源代码 
  onclick="window.location = 'view-source:'+ 'http://www.csdn.net/'"&gt; 
  </FONT>&nbsp;&nbsp;&nbsp;&nbsp; 
  <LI><FONT size=2><STRONG>关闭输入法</STRONG> <BR>&lt;input 
  style="ime-mode:disabled"&gt; </FONT>&nbsp;&nbsp;&nbsp;&nbsp; 
  <LI><STRONG>自动全选</STRONG> <BR>&lt;input type=text name=text1 value="123" 
  onfocus="this.select()"&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  <LI><FONT size=2><STRONG>ENTER键可以让光标移到下一个输入框 <BR></STRONG>&lt;input 
  onkeydown="if(event.keyCode==13)event.keyCode=9"&gt;</FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 

  <LI><STRONG>文本框的默认值 <BR></STRONG>&lt;input type=text value="123" 
  onfocus="alert(this.defaultValue)"&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  <LI><STRONG>title换行 <BR></STRONG>obj.title = 
  "123&amp;#13sdfs&amp;#32"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  <LI><FONT size=2><STRONG>获得时间所代表的微秒 <BR></STRONG>var n1 = new 
  Date("2004-10-10".replace(/-/g, 
  "\/")).getTime()</FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  <LI><FONT size=2><STRONG>窗口是否关闭 <BR></STRONG>win.closed 
  </FONT>&nbsp;&nbsp;&nbsp;&nbsp; 
  <LI><FONT size=2><STRONG>checkbox扁平 <BR></STRONG>&lt;input type=checkbox 
  style="position: absolute; clip:rect(5px 15px 15px 
  5px)"&gt;&lt;br&gt;</FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  <LI><STRONG>获取选中内容 
  <BR></STRONG>document.selection.createRange().duplicate().text&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 

  <LI><STRONG>自动完成功能 <BR></STRONG>&lt;input&nbsp;&nbsp;&nbsp; 
  type=text&nbsp;&nbsp;&nbsp; 
  autocomplete=on&gt;打开该功能&nbsp;&nbsp;<BR>&lt;input&nbsp;&nbsp;&nbsp; 
  type=text&nbsp;&nbsp;&nbsp; 
  autocomplete=off&gt;关闭该功能&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  <LI><FONT size=2><STRONG>窗口最大化</STRONG> <BR>&lt;body 
  onload="window.resizeTo(window.screen.width - 
  4,window.screen.height-50);window.moveTo(-4,-4)"&gt;</FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 

  <LI><FONT size=2><STRONG>无关闭按钮IE <BR></STRONG>window.open("aa.htm", "meizz", 
  "fullscreen=7"); </FONT>&nbsp;&nbsp;&nbsp;&nbsp; 
  <LI><STRONG>统一编码/解码 
  <BR></STRONG>alert(decodeURIComponent(encodeURIComponent("http://你好.com?as= 
  hehe"))) <BR>encodeURIComponent对":"、"/"、";" 和 
  "?"也编码&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  <LI><STRONG>表格行指示 <BR></STRONG>&lt;tr onmouseover="this.bgColor='#f0f0f0'" 
  onmouseout="this.bgColor='#ffffff'"&gt;&nbsp;&nbsp;&nbsp;&nbsp; 
</LI></UL></DIV>//POST代替FORM<FONT size=2> </FONT>
<DIV>&lt;SCRIPT language=<SPAN style="COLOR: #ff00ff">"VBScript"</SPAN>&gt; 
<BR>Function URLEncoding(vstrIn) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strReturn = 
<SPAN style="COLOR: #ff00ff">""</SPAN> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; For i 
= 1 To Len(vstrIn) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
ThisChr = Mid(vStrIn,i,1) 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Abs(Asc(ThisChr)) 
&lt; &amp;HFF Then 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
strReturn = strReturn &amp; ThisChr 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Else 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
innerCode = Asc(ThisChr) 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
If innerCode &lt; 0 Then 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
innerCode = innerCode + &amp;H10000 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
End If 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
Hight8 = (innerCode&nbsp;&nbsp;&nbsp; And &amp;HFF00)\ &amp;HFF 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
Low8 = innerCode And &amp;HFF 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
strReturn = strReturn &amp; <SPAN style="COLOR: #ff00ff">"%"</SPAN> &amp; 
Hex(Hight8) &amp;&nbsp;&nbsp;<SPAN style="COLOR: #ff00ff">"%"</SPAN> &amp; 
Hex(Low8) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Next <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
URLEncoding = strReturn <BR>End Function <BR>Function bytes2BSTR(vIn) 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strReturn = <SPAN 
style="COLOR: #ff00ff">""</SPAN> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; For i = 1 To 
LenB(vIn) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
ThisCharCode = AscB(MidB(vIn,i,1)) 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If ThisCharCode &lt; 
&amp;H80 Then 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
strReturn = strReturn &amp; Chr(ThisCharCode) 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Else 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
NextCharCode = AscB(MidB(vIn,i+1,1)) 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
strReturn = strReturn &amp; Chr(CLng(ThisCharCode) * &amp;H100 + 
CInt(NextCharCode)) 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
i = i + 1 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Next <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
bytes2BSTR = strReturn <BR>End Function <BR>dim strA,oReq <BR>strA = 
URLEncoding(<SPAN style="COLOR: #ff00ff">"submit1=Submit&amp;text1=中文"</SPAN>) 
<BR>set oReq = CreateObject(<SPAN 
style="COLOR: #ff00ff">"MSXML2.XMLHTTP"</SPAN>) <BR>oReq.open <SPAN 
style="COLOR: #ff00ff">"POST"</SPAN>,<SPAN style="COLOR: #ff00ff">"http:<SPAN 
style="COLOR: #008000">//ServerName/VDir/TstResult.asp"</SPAN>,false 
</SPAN><BR>oReq.setRequestHeader <SPAN 
style="COLOR: #ff00ff">"Content-Length"</SPAN>,Len(strA) 
<BR>oReq.setRequestHeader <SPAN 
style="COLOR: #ff00ff">"CONTENT-TYPE"</SPAN>,<SPAN 
style="COLOR: #ff00ff">"application/x-www-form-urlencoded"</SPAN> <BR>oReq.send 
strA <BR>msgbox bytes2BSTR(oReq.responseBody) <BR>&lt;/SCRIPT&gt; </DIV>
<P>//readyState是xmlhttp返回数据的进度,0=载入中,1=未初始化,2=已载入,3=运行中,4=完成</P>
<DIV>(1)拖拽访问 <BR>event.dataTransfer.setData(<SPAN 
style="COLOR: #ff00ff">"URL"</SPAN>, oImage.src); <BR>sImageURL = 
event.dataTransfer.getData(<SPAN style="COLOR: #ff00ff">"URL"</SPAN>) 
<BR>(2)普通访问 <BR>window.clipboardData.setData(<SPAN 
style="COLOR: #ff00ff">"Text"</SPAN>,oSource.innerText); 
<BR>window.clipboardData.getData(<SPAN style="COLOR: #ff00ff">"Text"</SPAN>); 
</DIV>
<DIV>&lt;HTML&gt; <BR>&lt;HEAD&gt; <BR>&lt;META NAME=<SPAN 
style="COLOR: #ff00ff">"save"</SPAN> CONTENT=<SPAN 
style="COLOR: #ff00ff">"history"</SPAN>&gt; <BR>&lt;STYLE&gt; 
<BR>&nbsp;&nbsp;&nbsp;&nbsp; .sHistory {behavior:url(#default#savehistory);} 
<BR>&lt;/STYLE&gt; <BR>&lt;/HEAD&gt; <BR>&lt;BODY&gt; <BR>&lt;INPUT 
class=sHistory type=text id=oPersistInput&gt; <BR>&lt;/BODY&gt; 
<BR>&lt;/HTML&gt; </DIV>
<DIV>&lt;p&nbsp;&nbsp;&nbsp; style=<SPAN 
style="COLOR: #ff00ff">"page-break-after:always"</SPAN>&gt;page1&lt;/p&gt;&nbsp;&nbsp;&nbsp;<BR>&lt;p&nbsp;&nbsp;&nbsp; 
style=<SPAN 
style="COLOR: #ff00ff">"page-break-after:always"</SPAN>&gt;page2&lt;/p&gt;&nbsp;&nbsp;&nbsp;</DIV>
<DIV>&lt;meta name=<SPAN style="COLOR: #ff00ff">"ROBOTS"</SPAN> content=<SPAN 
style="COLOR: #ff00ff">"属性值"</SPAN>&gt; <BR>  其中属性值有以下一些: <BR>  属性值为<SPAN 
style="COLOR: #ff00ff">"all"</SPAN>: 文件将被检索,且页上链接可被查询; <BR>  属性值为<SPAN 
style="COLOR: #ff00ff">"none"</SPAN>: 文件不被检索,而且不查询页上的链接; <BR>  属性值为<SPAN 
style="COLOR: #ff00ff">"index"</SPAN>: 文件将被检索; <BR>  属性值为<SPAN 
style="COLOR: #ff00ff">"follow"</SPAN>: 查询页上的链接; <BR>  属性值为<SPAN 
style="COLOR: #ff00ff">"noindex"</SPAN>: 文件不检索,但可被查询链接; <BR>  属性值为<SPAN 
style="COLOR: #ff00ff">"nofollow"</SPAN>:&nbsp;&nbsp;</DIV>
<DIV>&lt;object id=min classid=<SPAN 
style="COLOR: #ff00ff">"clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11"</SPAN>&gt;&nbsp;&nbsp;<BR>&lt;param 
name=<SPAN style="COLOR: #ff00ff">"Command"</SPAN> value=<SPAN 
style="COLOR: #ff00ff">"Minimize"</SPAN>&gt;&lt;/object&gt;&nbsp;&nbsp;<BR>&lt;object 
id=max classid=<SPAN 
style="COLOR: #ff00ff">"clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11"</SPAN>&gt;&nbsp;&nbsp;<BR>&lt;param 
name=<SPAN style="COLOR: #ff00ff">"Command"</SPAN> value=<SPAN 
style="COLOR: #ff00ff">"Maximize"</SPAN>&gt;&lt;/object&gt;&nbsp;&nbsp;<BR>&lt;OBJECT 
id=close classid=<SPAN 
style="COLOR: #ff00ff">"clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"</SPAN>&gt;&nbsp;&nbsp;<BR>&lt;PARAM 
NAME=<SPAN style="COLOR: #ff00ff">"Command"</SPAN> value=<SPAN 
style="COLOR: #ff00ff">"Close"</SPAN>&gt;&lt;/OBJECT&gt;&nbsp;&nbsp;<BR>&lt;input 
type=button value=最小化 onclick=min.Click()&gt;&nbsp;&nbsp;<BR>&lt;input 
type=button value=最大化 onclick=max.Click()&gt;&nbsp;&nbsp;<BR>&lt;input 
type=button value=关闭 onclick=close.Click()&gt;&nbsp;&nbsp;</DIV>
<DIV>&lt;META HTTP-EQUIV=<SPAN style="COLOR: #ff00ff">"pragma"</SPAN> 
CONTENT=<SPAN style="COLOR: #ff00ff">"no-cache"</SPAN>&gt; <BR>&lt;META 
HTTP-EQUIV=<SPAN style="COLOR: #ff00ff">"Cache-Control"</SPAN> CONTENT=<SPAN 
style="COLOR: #ff00ff">"no-cache, must-revalidate"</SPAN>&gt; <BR>&lt;META 
HTTP-EQUIV=<SPAN style="COLOR: #ff00ff">"expires"</SPAN> CONTENT=<SPAN 
style="COLOR: #ff00ff">"0"</SPAN>&gt; </DIV>
<DIV>&lt;input type=button value=导入收藏夹 onclick=<SPAN 
style="COLOR: #ff00ff">"window.external.ImportExportFavorites(true,'http:<SPAN 
style="COLOR: #008000">//localhost');"</SPAN>&gt; </SPAN><BR>&lt;input 
type=button value=导出收藏夹 onclick=<SPAN 
style="COLOR: #ff00ff">"window.external.ImportExportFavorites(false,'http:<SPAN 
style="COLOR: #008000">//localhost');"</SPAN>&gt; </SPAN><BR>&lt;input 
type=button value=整理收藏夹 onclick=<SPAN 
style="COLOR: #ff00ff">"window.external.ShowBrowserUI('OrganizeFavorites', 
null)"</SPAN>&gt; <BR>&lt;input type=button value=语言设置&nbsp;&nbsp;&nbsp;&nbsp; 
onclick=<SPAN 
style="COLOR: #ff00ff">"window.external.ShowBrowserUI('LanguageDialog', 
null)"</SPAN>&gt; <BR>&lt;input type=button value=加入收藏夹 onclick=<SPAN 
style="COLOR: #ff00ff">"window.external.AddFavorite('http:<SPAN 
style="COLOR: #008000">//www.google.com/', 'google')"</SPAN>&gt; 
</SPAN><BR>&lt;input type=button value=加入到频道 onclick=<SPAN 
style="COLOR: #ff00ff">"window.external.addChannel('http:<SPAN 
style="COLOR: #008000">//www.google.com/')"</SPAN>&gt; </SPAN><BR>&lt;input 
type=button value=加入到频道 onclick=<SPAN 
style="COLOR: #ff00ff">"window.external.showBrowserUI('PrivacySettings',null)"</SPAN>&gt; 
</DIV>
<DIV>&lt;input type=text onkeypress=<SPAN style="COLOR: #ff00ff">"return 
event.keyCode&gt;=48&amp;&amp;event.keyCode&lt;=57||(this.value.indexOf('.')&lt;0?event.keyCode==46:false)"</SPAN> 
onpaste=<SPAN style="COLOR: #ff00ff">"return 
!clipboardData.getData('text').match(/\D/)"</SPAN> ondragenter=<SPAN 
style="COLOR: #ff00ff">"return false"</SPAN>&gt; </DIV>
<P>language=<SPAN style="COLOR: #ff00ff">"javascript"</SPAN>&gt; <BR><SPAN 
style="COLOR: #0000ff">function</SPAN> jStartExcel() { <BR><SPAN 
style="COLOR: #0000ff">var</SPAN> xls = <SPAN style="COLOR: #0000ff">new</SPAN> 
<SPAN style="COLOR: #ff0000">ActiveXObject</SPAN> ( <SPAN 
style="COLOR: #ff00ff">"Excel.Application"</SPAN> ); <BR>xls.visible = <SPAN 
style="COLOR: #0000ff">true</SPAN>; <BR><SPAN style="COLOR: #0000ff">var</SPAN> 
newBook = xls.Workbooks.Add; <BR>newBook.Worksheets.Add; 
<BR>newBook.Worksheets(1).Activate; 
<BR>xls.ActiveWorkBook.ActiveSheet.PageSetup.Orientation = 2; 
<BR>xls.ActiveWorkBook.ActiveSheet.PageSetup.PaperSize = 5; 
<BR>newBook.Worksheets(1).Columns(<SPAN 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -