{"id":319,"date":"2009-04-16T21:15:00","date_gmt":"2009-04-16T01:15:00","guid":{"rendered":""},"modified":"2013-11-29T12:03:44","modified_gmt":"2013-11-29T04:03:44","slug":"%e5%b8%b8%e7%94%a8javascript%e8%84%9a%e6%9c%ac","status":"publish","type":"post","link":"https:\/\/kyle.ai\/blog\/319.html","title":{"rendered":"\u5e38\u7528JavaScript\u811a\u672c"},"content":{"rendered":"<p>1.\u900f\u660eFlash\u4ee3\u7801<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;param name=&quot;wmode&quot; value=&quot;transparent&quot;&gt;\r\n<\/pre>\n<p>2.\u52a0\u5165\u6536\u85cf<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;a href=&quot;JavaScript:window.external.addfavorite(\u2018http:\/\/www.yongfa365.com\u2019,'\u67f3\u6c38\u6cd5(yongfa365)\\\u2019Blog\u2019)&quot; target=&quot;_top&quot;&gt;\u52a0\u5165\u6536\u85cf&lt;\/a&gt;\r\n<\/pre>\n<p>3.\u8bbe\u4e3a\u9996\u9875<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;a href=&quot;#&quot; target=&quot;_self&quot;   style=&quot;cursor:hand&quot; onclick=this.style.behavior=&quot;url(#default#homepage)&quot;;this.sethomepage(&quot;http:\/\/www.yongfa365.com&quot;)&gt;\u8bbe\u4e3a\u9996\u9875&lt;\/a&gt;\r\n<\/pre>\n<p>4.\u4e0d\u540c\u65f6\u95f4\u6bb5\u663e\u793a\u4e0d\u540c\u95ee\u5019\u8bed<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n   &lt;Script Language=&quot;JavaScript&quot;&gt;\r\n   &lt;!\u2013\r\n   var text=&quot;&quot;; day = new Date( ); time = day.getHours( );\r\n   if (( time&gt;=0) &amp;&amp; (time &lt; 7 ))\r\n     text=&quot;\u591c\u732b\u5b50,\u8981\u6ce8\u610f\u8eab\u4f53\u54e6! &quot;\r\n   if (( time &gt;= 7 ) &amp;&amp; (time &lt; 12))\r\n     text=&quot;\u4eca\u5929\u5929\u6c14\u2026\u2026\u54c8\u54c8\u54c8,\u4e0d\u53bb\u73a9\u5417?&quot;\r\n   if (( time &gt;= 12) &amp;&amp; (time &lt; 14))\r\n     text=&quot;\u5348\u4f11\u65f6\u95f4\u54e6,\u670b\u53cb\u4e00\u5b9a\u662f\u4e0d\u4e60\u60ef\u5348\u7761\u7684\u5427?!&quot;\r\n   if (( time &gt;=14) &amp;&amp; (time &lt; 18))\r\n     text=&quot;\u4e0b\u5348\u8336\u7684\u65f6\u95f4\u5230\u4e86,\u4f11\u606f\u4e00\u4e0b\u5427! &quot;\r\n   if ((time &gt;= 18) &amp;&amp; (time &lt;= 22))\r\n     text=&quot;\u60a8\u53c8\u6765\u4e86,\u53ef\u522b\u548cMM\u804a\u592a\u4e45\u54e6!&quot;\r\n   if ((time &gt;= 22) &amp;&amp; (time &lt; 24))\r\n     text=&quot;\u5f88\u665a\u4e86\u54e6,\u6ce8\u610f\u4f11\u606f\u5440!&quot;\r\n   document.write(text)\r\n   \/\/\u2014&gt;\r\n   &lt;\/Script&gt;\r\n<\/pre>\n<p>5.\u6539\u53d8IE\u5730\u5740\u680f\u7684IE\u56fe\u6807<br \/>\n\u6211\u4eec\u8981\u5148\u505a\u4e00\u4e2a16*16\u7684icon(\u56fe\u6807\u6587\u4ef6),\u4fdd\u5b58\u4e3aindex.ico\uff61\u628a\u8fd9\u4e2a\u56fe\u6807\u6587\u4ef6\u4e0a\u4f20\u5230\u6839\u76ee\u5f55\u4e0b\u5e76\u5728\u9996\u9875\u4e4b\u95f4\u52a0\u4e0a\u5982\u4e0b\u4ee3\u7801:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;link REL = &quot;Shortcut Icon&quot; href=&quot;index.ico&quot;&gt;\r\n<\/pre>\n<p>6.2\u79d2\u540e\u8f7d\u5165\u6307\u5b9a\u7f51\u9875<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n   &lt;head&gt;\r\n   &lt;meta http-equiv=&quot;refresh&quot; content=&quot;2;URL=http:\/\/www.yongfa365.com\/blog&quot;&gt;\r\n   &lt;\/head&gt;\r\n<\/pre>\n<p>7.\u663e\u793a\u5f53\u524d\u65e5\u671f\uff0c\u661f\u671f<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;Script Language=&quot;JavaScript&quot;&gt;\r\n&lt;!\u2013\r\nvar today=new Date();\r\nvar strDate=(&quot; &quot;+today.getYear()+&quot;\u5e74&quot;+(today.getMonth()+1)+&quot;\u6708&quot;+today.getDate()+&quot;\u65e5&quot;);\r\nvar n_day=today.getDay();switch(n_day)\r\n{case 0:\r\n{strDate=strDate+&quot;(\u661f\u671f\u65e5)&quot;}break;\r\ncase 1:\r\n{strDate=strDate+&quot;(\u661f\u671f\u4e00)&quot;}break;\r\ncase 2:\r\n{strDate=strDate+&quot;(\u661f\u671f\u4e8c)&quot;}break;\r\ncase 3:\r\n{strDate=strDate+&quot;(\u661f\u671f\u4e09)&quot;}break;\r\ncase 4:\r\n{strDate=strDate+&quot;(\u661f\u671f\u56db)&quot;}break;\r\ncase 5:\r\n{strDate=strDate+&quot;(\u661f\u671f\u4e94)&quot;}break;\r\ncase 6:\r\n{strDate=strDate+&quot;(\u661f\u671f\u516d)&quot;}break;\r\ncase 7:\r\n{strDate=strDate+&quot;(\u661f\u671f\u65e5)&quot;}break;\r\n}\r\ndocument.write(strDate);\r\n\/\/   \u2013&gt;\r\n&lt;\/Script&gt;\r\n<\/pre>\n<p>8.\u6eda\u52a8\u4ee3\u7801<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;marquee direction=up scrolldelay=200   scrollamount=1 width=206 height=207   onmouseover=this.stop() onmouseout=this.start()&gt;\u5927\u5bb6\u597d&lt;\/marquee&gt;\r\n<\/pre>\n<p>9.\u8fd9\u4e2a\u6bd4\u8f83\u5e38\u7528\uff0c\u4e00\u822c\u7528\u6765\u5904\u7406\u957f\u4e32\u8fde\u7eed\u82f1\u6587\u6491\u7834\u8868\u683c\u7684\u95ee\u9898<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;td style=&quot;word-break:break-all&quot;&gt;\r\n<\/pre>\n<p>10.\u56fe\u7247\u6e10\u6e10\u663e\u793a\u51fa\u6765<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;SCRIPT language=&quot;JavaScript&quot;&gt;\r\n&lt;!\u2013\r\nfunction makevisible(cur,which)\r\n{\r\nif (which==0)\r\ncur.filters.alpha.opacity=100\r\nelse\r\ncur.filters.alpha.opacity=50\r\n}\r\n\/\/\u2013&gt;\r\n&lt;\/SCRIPT&gt;\r\n\r\n&lt;img src=&quot;yongfa.gif&quot; style=&quot;filter:alpha(opacity=20)&quot; onMouseOver=&quot;makevisible(this,0)&quot; onMouseOut=&quot;makevisible(this,1)&quot;&gt;\r\n<\/pre>\n<p>11.\u5220\u9664\u6587\u4ef6<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;%\r\nset fso=server.CreateObject(&quot;scripting.filesystemobject&quot;)\r\nfilename1=server.MapPath(&quot;Pic&quot;)\r\nif fso.fileexists(filename1) then\r\nfso.deletefile filename1\r\nend if\r\n%&gt;\r\n<\/pre>\n<p>12.mailto<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;a href=mailto:123456789@163.com;heroyongfa@163.com?cc=12345@163.com&amp;bcc=1234567890@sina.com&amp;subject=\u60a8\u505a\u7684\u7f51\u9875\u4e0d\u9519\u5440&amp;body=\u518d\u63a5\u518d\u5389&gt;E-mail&lt;\/a&gt;\r\n<\/pre>\n<p>13.\u5185\u5bb9\u663e\u793aor\u9690\u85cf<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;script language=&quot;JavaScript&quot;&gt;\r\nfunction show(i){\r\nif (i.style.display == &quot;none&quot;) {\r\n   i.style.display = &quot;&quot;;\r\n}else{\r\n   i.style.display = &quot;none&quot;;\r\n}\r\n}\r\n&lt;\/script&gt;\r\n\r\n&lt;div onClick=&quot;show(a1)&quot;   style=&quot;cursor:hand&quot; &gt;\u6807\u9898&lt;\/div&gt;\r\n&lt;DIV id=a1 style=&quot;DISPLAY: none&quot;&gt;\u5185\u5bb9&lt;\/DIV&gt;\r\n<\/pre>\n<p>14.Window.open<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\nwindow.open (\u2018page.html\u2019, \u2018newwindow\u2019, \u2018height=100, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no\u2019)\r\n<\/pre>\n<p>15.\u4e24\u6b21\u786e\u8ba4\u662f\u5426\u5220\u9664\uff08\u4e5f\u4e0d\u77e5\u8fd9\u5ba2\u6237\u662f\u600e\u4e48\u4e86\uff09<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;input type=&quot;button&quot; name=&quot;Submit2&quot; value=&quot;\u5220\u9664&quot; onclick=&quot; javasctipt:if (window.confirm(\u2018\u786e\u5b9a\u5220\u9664\u5417\uff1f\u2019)){if (window.confirm(\u2018\u786e\u5b9a\u5220\u9664\u5417\uff1f\u2019)){window.location.href=\u2019?action=del&amp;id=&lt;%=rs(&quot;id&quot;)%&gt;\u2019}}&quot; &gt;\r\n<\/pre>\n<p>16.\u6309\u94ae\u7248\u786e\u5b9a\u5220\u9664\u5417\uff1f<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;input type=&quot;button&quot; name=&quot;Submit5&quot; value=&quot;\u5220\u9664&quot; onclick=&quot;if (confirm(\u2018\u60a8\u786e\u5b9a\u8981\u5220\u9664\u561b?\u2019)){window.location.href=\u2019?action=delok&amp;id=&lt;%=rs(&quot;id&quot;)%&gt;\u2019;}&quot; \/&gt;\r\n<\/pre>\n<p>17.\u5206\u7c7b\u5168\u9009\u8bb0\u5f55\u7684\u51fd\u6570<\/p>\n<p>\u6f14\u793a\u4ee3\u7801\uff0c\u53ea\u8981checkbox\u7684name\u4e00\u6837\u5c31\u53ef\u4ee5<br \/>\n\u8c03\u7528\u65f6\u7528checkall(this,\u2019checkboxname\u2019)\u5c31\u53ef\u4ee5<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;script language=JavaScript&gt;\r\nfunction checkall(all,checkname)\/\/\u7528\u4e8e\u5224\u65ad\u5168\u9009\u8bb0\u5f55\u7684\u51fd\u6570\r\n{\r\nvar a = document.getElementsByName(checkname);\r\nfor (var i=0; i&lt;a.length; i++) a&#x5B;i].checked = all.checked;\r\n}\r\n&lt;\/script&gt;\r\n\r\n&lt;input type=&quot;checkbox&quot; name=&quot;chkall&quot; value=&quot;on&quot; onClick=&quot;checkall(this,\u2019question\u2019)&quot;&gt;\r\n<\/pre>\n<p>18.\u6253\u5370\u672c\u9875<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\nwindow.print()\r\n<\/pre>\n<p>19.\u5f15\u7528upload.html iframe<br \/>\n\u4ee5\u4e0b\u4e3a\u7f16\u8f91\u5668\u7684\u7b80\u5355\u8c03\u7528<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n\u6dfb\u52a0:\r\n&lt;input type=&quot;hidden&quot; name=&quot;content1&quot; value=&quot;&quot;&gt;\r\n&lt;iframe ID=&quot;eWebEditor1&quot; src=&quot;..\/ewebeditor.asp?id=content1&amp;style=standard&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot; width=&quot;500&quot; HEIGHT=&quot;350&quot;&gt;&lt;\/iframe&gt;\r\n\u4fee\u6539:\r\n&lt;input type=&quot;hidden&quot; name=&quot;content1&quot; value=&quot;&lt;%=Server.HTMLEncode(Rs(&quot;Content&quot;))%&gt;&quot;&gt;\r\n&lt;iframe ID=&quot;eWebEditor1&quot; src=&quot;..\/ewebeditor.asp?id=content1&amp;style=standard&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot; width=&quot;500&quot; HEIGHT=&quot;350&quot;&gt;&lt;\/iframe&gt;\r\n<\/pre>\n<p>21.\u63d2\u5165Flash<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;object classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot; codebase=&quot;http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=7,0,19,0&quot; width=&quot;684&quot; height=&quot;316&quot;&gt;\r\n           &lt;param name=&quot;movie&quot; value=&quot;images\/111.swf&quot;&gt;\r\n           &lt;param name=&quot;wmode&quot; value=&quot;transparent&quot;&gt;\r\n           &lt;param name=&quot;quality&quot; value=&quot;high&quot;&gt;\r\n           &lt;embed src=&quot;images\/111.swf&quot; quality=&quot;high&quot; pluginspage=&quot;http:\/\/www.macromedia.com\/go\/getflashplayer&quot; type=&quot;application\/x-shockwave-flash&quot; width=&quot;684&quot; height=&quot;316&quot;&gt;&lt;\/embed&gt;\r\n      &lt;\/object&gt;\r\n<\/pre>\n<p>22.select\u6539\u53d8\u65f6 \u8df3\u8f6c\u6216\u6267\u884c\u64cd\u4f5c<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n\u5929\u6c14:&lt;input name=&quot;weather&quot; type=&quot;text&quot; id=&quot;weather&quot; size=&quot;5&quot;&gt;\r\n&lt;select name=&quot;selectweather&quot; onChange=&quot;weather.value=this.options&#x5B;selectedIndex].value&quot;&gt;\r\n&lt;option value=&quot;\u5929\u6c14&quot;&gt;\u5929\u6c14&lt;\/option&gt;\r\n&lt;option value=&quot;\u775b&quot;&gt;\u775b&lt;\/option&gt;\r\n&lt;option value=&quot;\u9634&quot;&gt;\u9634&lt;\/option&gt;\r\n&lt;option value=&quot;\u5c0f\u96e8&quot;&gt;\u5c0f\u96e8&lt;\/option&gt;\r\n&lt;option value=&quot;\u591a\u4e91&quot;&gt;\u591a\u4e91&lt;\/option&gt;\r\n&lt;option value=&quot;\u9635\u96e8&quot;&gt;\u9635\u96e8&lt;\/option&gt;\r\n&lt;option value=&quot;\u8fde\u9634&quot;&gt;\u8fde\u9634&lt;\/option&gt;\r\n&lt;option value=&quot;\u5c0f\u96ea&quot;&gt;\u5c0f\u96ea&lt;\/option&gt;\r\n&lt;\/select&gt;\r\n<\/pre>\n<p>23.\u5e94\u4ed8\u6846\u67b6\u91cc\u767b\u5f55\u7684\u95ee\u9898<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n\u2018\u628a\u4e0b\u8fb9\u8fd9\u4e2a\u653e\u5728\u767b\u5f55\u9875\u9762head\u91cc\r\n\r\n&lt;script language=&quot;JavaScript&quot;&gt;\r\nif (self!=top){top.location=\u2019admin_login.asp\u2019;}\r\n&lt;\/script&gt;\r\n\r\n\u2018\u6216\u8fd9\u6837\u5199\r\n\r\nresponse.redirect &quot; &lt;script language=\u2019JavaScript\u2019&gt;top.location=\u2019login.asp\u2019&lt;\/script&gt;&quot;\r\n<\/pre>\n<p>24.Ctrl+Enter\u63d0\u4ea4\u8868\u5355<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;textarea name=&quot;co&quot; cols=&quot;50&quot; rows=&quot;10&quot; onKeyDown=&quot;ctlSubmit(event);&quot;   style=&quot;width:97%;&quot;&gt;&lt;\/textarea&gt;\r\n\r\n&lt;script&gt;\r\nfunction ctlSubmit(event) {\r\nif (event.ctrlKey &amp;&amp; event.keyCode == 13) { form1.submit() }\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>25.\u53ea\u80fd\u8f93\u5165\u6570\u5b57\u4e14\u6570\u5b57\u8981\u5927\u4e8e3<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;script&gt;\r\nfunction min_in()\r\n{\r\nif (event.keyCode &lt; 45 || event.keyCode &gt; 57){alert(\u2018\u540c\u5fd7\u53ea\u80fd\u8f93\u5165\u6570\u5b57\uff0c\u8c22\u8c22\u2019); event.returnValue = false;}\r\n}\r\n\r\nfunction check_input(aaa)\r\n{\r\nif (aaa!=\u201d&amp;&amp;aaa&lt;3)\r\n{\r\nalert(&quot;\u54e5\u54e5\uff0c\u592a\u5c11\u4e86&quot;);\r\nreturn false;\r\n}\r\n}\r\n&lt;\/script&gt;\r\n&lt;input type=&quot;text&quot; name=&quot;money&quot; value=&quot;&quot; onKeypress=&quot;return min_in()&quot; onblur=&quot;check_input(this.value)&quot; &gt;\r\n<\/pre>\n<p>26.\u5168\u9009\u4e0e\u53cd\u9009<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\nfunction CheckOthers(form)\r\n{\r\nfor (var i=0;i&lt;form.elements.length;i++)\r\n{\r\n   var e = form.elements&#x5B;i];\r\n    if (e.checked==false)\r\n    {\r\n     e.checked = true;\r\n    }\r\n    else\r\n    {\r\n     e.checked = false;\r\n    }\r\n}\r\n}\r\n\r\nfunction CheckAll(form)\r\n{\r\nfor (var i=0;i&lt;form.elements.length;i++)\r\n{\r\n   var e = form.elements&#x5B;i];\r\n    e.checked = true;\r\n}\r\n}\r\n<\/pre>\n<p>30.\u6539\u53d8obj\u7684class\u5c5e\u6027\u503c<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;head&gt;\r\n   &lt;style&gt;\r\n   .aa{color:red}\r\n   .bb{color:blue}\r\n   &lt;\/style&gt;\r\n   &lt;\/head&gt;\r\n   &lt;body&gt;\r\n   &lt;form    name=form1&gt;\r\n   &lt;input    name=txt1    value=&quot;\u6d4b\u8bd5&quot;    class=&quot;aa&quot;&gt;\r\n   &lt;input    type=&quot;button&quot;    onclick=&quot;form1.txt1.className=\u2019bb\u2019&quot;    value=&quot;\u6539\u53d8&quot;&gt;\r\n   &lt;\/form&gt;\r\n   &lt;\/dody&gt;\r\n<\/pre>\n<p>31.\u5982\u4f55\u5728\u6807\u9898\u680f\u663e\u793a\u6846\u67b6\u5185\u9875\u9762\u7684\u6807\u9898<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\ntop.document.title = document.title\r\n<\/pre>\n<p>32.\u811a\u672c\u6c38\u4e0d\u51fa\u9519<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;SCRIPT LANGUAGE=&quot;JavaScript&quot;&gt;\r\n&lt;!\u2013 Hide\r\nfunction killErrors() {\r\nreturn true;\r\n}\r\nwindow.onerror = killErrors;\r\n\/\/ \u2013&gt;\r\n&lt;\/SCRIPT&gt;\r\n<\/pre>\n<p>33.\u8ba9\u8f93\u5165\u6846\u5173\u95ed\u81ea\u52a8\u5b8c\u6210\uff08AutoComplete\uff09\u529f\u80fd<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;form&gt;\r\n\u8ba9\u8f93\u5165\u6846\u5173\u95ed\u81ea\u52a8\u5b8c\u6210\uff08AutoComplete\uff09\u529f\u80fd&lt;br \/&gt;\r\n\u6d4b\u8bd5\u65b9\u6cd5:\u5206\u522b\u53cc\u51fb\u4e24\u4e2a\u6587\u672c\u6846\u770b\u770b\u6709\u4ec0\u4e48\u4e0d\u4e00\u6837&lt;br \/&gt;\r\n\u9ed8\u8ba4:&lt;input name=&quot;UserName&quot; type=&quot;text&quot; \/&gt;&lt;br \/&gt;\r\n\u5173\u95ed:&lt;input name=&quot;UserName&quot; type=&quot;text&quot; autocomplete=&quot;off&quot; \/&gt;&lt;br \/&gt;\r\n&lt;\/form&gt;\r\n<\/pre>\n<p>34.\u5339\u914d\u6240\u6709\u6ca1\u6709alt\u5c5e\u6027\u7684img\u7684\u6b63\u5219\u8868\u8fbe\u5f0f<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;img(?!.*?alt)(.*?)&gt;\r\n<\/pre>\n<p>35.\u5f97\u5230\u5b57\u7b26\u4e32\u7684\u4e2d\u6587|\u82f1\u6587|\u6570\u5b57|\u5168\u90e8\u957f\u5ea6,\u8fd4\u56de\u503c\u4e3a\u5b57\u8282\u6570<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n\/\/\u5f97\u5230\u5b57\u7b26\u4e32\u7684\u4e2d\u6587|\u82f1\u6587|\u6570\u5b57|\u5168\u90e8\u957f\u5ea6,\u8fd4\u56de\u503c\u4e3a\u5b57\u8282\u6570\r\n\/\/strtype=&quot;cn&quot;|&quot;en&quot;|&quot;num&quot;|&quot;all&quot;\r\n\r\nfunction GetStrNum(str, strtype)\r\n{\r\n    var ch, num_cn = 0, num_en = 0, num_num = 0, num_other = 0;\r\n    for (var i = 0; i &lt; str.length; i++)\r\n    {\r\n        ch = str.substr(i, 1);\r\n        if (\/&#x5B;^\\x00-\\xff]\/.test(ch))\r\n        {num_cn += 2;}\r\n        else if (\/\\w\/.test(ch))\r\n        {num_en += 1;}\r\n        else if (\/\\d\/.test(ch))\r\n        {num_num += 1;}\r\n        else\r\n        {num_other += 1;}\r\n    }\r\n    switch (strtype)\r\n    {\r\n        case &quot;cn&quot;:\r\n            return num_cn;\r\n        case &quot;en&quot;:\r\n            return num_en;\r\n        case &quot;num&quot;:\r\n            return num_num;\r\n        default:\r\n            return num_cn + num_en + num_num + num_other;\r\n    }\r\n}\r\n<\/pre>\n<p>36.\u5f97\u5230\u4e00\u5b57\u7b26\u4e32\u7684\u957f\u5ea6\u6700\u77ed\u7684\u4ee3\u7801<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&quot;\u6211i&quot;.replace(\/&#x5B;^\\x00-\\xFF]\/g,&quot;aa&quot;).length\r\n\u60a8\u53ef\u4ee5\u76f4\u63a5\u5728URL\u91cc\u8f93\u5165 : javascript:alert(&quot;\u6211i&quot;.replace(\/&#x5B;^\\x00-\\xFF]\/g,&quot;aa&quot;).length)\r\n<\/pre>\n<p>37.\u5f53\u522b\u4ebaCopy\u4f60\u7684\u6587\u7ae0\u65f6\uff0c\u81ea\u52a8\u5728\u6587\u7ae0\u540e\u8fb9\u52a0\u4e0a\u3000\u8f6c\u81ea\uff1a\u3002\u3002\u3002\u3002\u3002<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\ndocument.body.oncopy = function () { setTimeout( function () { var text = clipboardData.getData(&quot;text&quot;); if (text) { text = text + &quot;\\n\u3000\u3000\u8f6c\u81ea\uff1a&quot; + location.href; clipboardData.setData(&quot;text&quot;, text); } }, 100 ) }\r\n<\/pre>\n<p>39.\u6d88\u9664\u56fe\u50cf\u5de5\u5177\u680f\uff0c\u9f20\u6807\u653e\u5728\u7f51\u9875\u4e0a\u7684\u56fe\u7247\u4e0a\u65f6\u4f1a\u663e\u793a\u4e00\u4e2a\u4fdd\u5b58\u56fe\u50cf\u7684\u5de5\u5177\u680f\uff0c\u600e\u4e48\u53bb\u6389\uff1f<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n\u5355\u4e2a\u56fe\u7247\u53ef\u4ee5\u8fd9\u6837\uff1a\r\n&lt;img src=&quot;http:\/\/www.baidu.com\/img\/logo.gif&quot; galleryimg=&quot;false&quot;&gt;\r\n\u5982\u679c\u60f3\u8ba9\u7f51\u9875\u5185\u6240\u6709\u56fe\u7247\u90fd\u4e0d\u51fa\u73b0\u5de5\u5177\u680f\uff0c\u53ef\u4ee5\u7528\u4e0b\u8fb9\u8fd9\u4e2a\r\n&lt;head&gt;\r\n&lt;meta http-equiv=&quot;imagetoolbar&quot; content=&quot;no&quot;&gt;\r\n&lt;\/head&gt;\r\n<\/pre>\n<p>40.\u54ea\u679c\u60a8\u7684\u7f51\u9875\u7f16\u7801\u662fXHTML 1.0\u90a3\u4e48\uff0c\u4f60\u5f97:<\/p>\n<p>document.body\u6362\u6210document.documentElement,\u6216\u8005\u60a8\u53ef\u4ee5\u5148\u5224\u65ad\u4e00\u4e0b\uff1a<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\nif (document.documentElement)\r\nobjBody = document.documentElement\r\nelse if (document.body)\r\nobjBody = document.body\r\nelse\r\n    {\/*Netscape stuff*\/}\r\n<\/pre>\n<p>41.\u7f51\u9875\u5c4f\u5e55\u76f8\u5173\u5c5e\u6027\u6d4b\u8bd5<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;body&gt;\r\n&lt;script language=&quot;javascript&quot;&gt;\r\nvar s = &quot;&quot;;\r\ns += &quot;\\r\\n\u7f51\u9875\u53ef\u89c1\u533a\u57df\u5bbd\uff1a&quot;+ document.body.clientWidth;\r\ns += &quot;\\r\\n\u7f51\u9875\u53ef\u89c1\u533a\u57df\u9ad8\uff1a&quot;+ document.body.clientHeight;\r\ns += &quot;\\r\\n\u7f51\u9875\u53ef\u89c1\u533a\u57df\u5bbd\uff1a&quot;+ document.body.offsetWidth +&quot; (\u5305\u62ec\u8fb9\u7ebf\u548c\u6eda\u52a8\u6761\u7684\u5bbd)&quot;;\r\ns += &quot;\\r\\n\u7f51\u9875\u53ef\u89c1\u533a\u57df\u9ad8\uff1a&quot;+ document.body.offsetHeight +&quot; (\u5305\u62ec\u8fb9\u7ebf\u7684\u5bbd)&quot;;\r\ns += &quot;\\r\\n\u7f51\u9875\u6b63\u6587\u5168\u6587\u5bbd\uff1a&quot;+ document.body.scrollWidth;\r\ns += &quot;\\r\\n\u7f51\u9875\u6b63\u6587\u5168\u6587\u9ad8\uff1a&quot;+ document.body.scrollHeight;\r\ns += &quot;\\r\\n\u7f51\u9875\u88ab\u5377\u53bb\u7684\u9ad8\uff1a&quot;+ document.body.scrollTop;\r\ns += &quot;\\r\\n\u7f51\u9875\u88ab\u5377\u53bb\u7684\u5de6\uff1a&quot;+ document.body.scrollLeft;\r\ns += &quot;\\r\\n\u7f51\u9875\u6b63\u6587\u90e8\u5206\u4e0a\uff1a&quot;+ window.screenTop;\r\ns += &quot;\\r\\n\u7f51\u9875\u6b63\u6587\u90e8\u5206\u5de6\uff1a&quot;+ window.screenLeft;\r\ns += &quot;\\r\\n\u5c4f\u5e55\u5206\u8fa8\u7387\u7684\u9ad8\uff1a&quot;+ window.screen.height;\r\ns += &quot;\\r\\n\u5c4f\u5e55\u5206\u8fa8\u7387\u7684\u5bbd\uff1a&quot;+ window.screen.width;\r\ns += &quot;\\r\\n\u5c4f\u5e55\u53ef\u7528\u5de5\u4f5c\u533a\u9ad8\u5ea6\uff1a&quot;+ window.screen.availHeight;\r\ns += &quot;\\r\\n\u5c4f\u5e55\u53ef\u7528\u5de5\u4f5c\u533a\u5bbd\u5ea6\uff1a&quot;+ window.screen.availWidth;\r\ns += &quot;\\r\\n\u4f60\u7684\u5c4f\u5e55\u8bbe\u7f6e\u662f &quot;+ window.screen.colorDepth +&quot; \u4f4d\u5f69\u8272&quot;;\r\ns += &quot;\\r\\n\u4f60\u7684\u5c4f\u5e55\u8bbe\u7f6e &quot;+ window.screen.deviceXDPI +&quot; \u50cf\u7d20\/\u82f1\u5bf8&quot;;\r\nalert(s);\r\n&lt;\/script&gt;\r\n&lt;\/body&gt;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>1.\u900f\u660eFlash\u4ee3\u7801 &lt;param name=&quot;wmode&quot; value=&#038;quo [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-319","post","type-post","status-publish","format-standard","hentry","category-code_related"],"_links":{"self":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/319","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/comments?post=319"}],"version-history":[{"count":2,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/319\/revisions"}],"predecessor-version":[{"id":5308,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/319\/revisions\/5308"}],"wp:attachment":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/media?parent=319"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/categories?post=319"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/tags?post=319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}