丄諦啲仇魜ヤ
          如 果 敵 人 讓 你 生 氣 , 那 說(shuō) 明 你 沒(méi) 有 勝 他 的 把 握!
          posts - 6,comments - 56,trackbacks - 1
          1.鼠標(biāo)移動(dòng)上去,圖片變亮,移開(kāi)又變成灰色。改變的是透明度。
          <style>
          .p1{filter:Alpha(Opacity=20)}
          .p2{filter:Alpha(Opacity=100)}
          </style>
          <img src="/image/xxx.gif" border=0 class=p1 on mouseover="this.classname=p2"   on mouseout="this.classname=p1">
          2.怎樣在網(wǎng)頁(yè)中播放mp3格式音樂(lè)
          <html>
          <title></title>
          <body>
          <embed src="http://music.jztele.com/mp3/dianying/xyxy.mp3"; loop=false autostart=true name=bgss width="0" height=0>
          </body>
          </html>
          詳細(xì)說(shuō)明:
          <embed
          src="xx.mp3" 音樂(lè)文件
          loop=false 是否重復(fù)播放
          autostart=true 是否自動(dòng)開(kāi)始
          name=bgss 為了控制而設(shè)定的名字
          width="0" height="0" 寬、高 >
          3.滾動(dòng)現(xiàn)實(shí)公告
          <table width="800" border="0" cellspacing="0" cellpadding="0">
          <tbody>
          <tr style="text-align: center;">
          <td height="0"> <hr noshade> <p>
          <marquee>
          <xmp> 事件文字滾動(dòng) ——公告</xmp>
          </marquee>
          </p>
          <hr noshade></td>
          </tr>
          </tbody>
          </table>
          4.以圖片作為按鈕
          <form method="post" action="test.html">
          <input type="text" name="textfield">
          <input type="text" name="textfield2">
          <input type="image" border="0" name="imageField" src="../img/submit.jpg" width="71" height="32" >
          </form>
          5.表格中單元格之間分隔線的隱藏方法
          其實(shí)上面的三個(gè)表格都有三行三列,隱藏分隔線的訣竅在于rules,察看這三個(gè)表格的源代碼,我們可以看到<TABLE>標(biāo)簽中都有rules。 它有三個(gè)參數(shù)(cols,rows,none),當(dāng)rules=cols時(shí),表格會(huì)隱藏縱向的分隔線,這樣我們就只能看到表格的行;當(dāng)rules=rows時(shí),則 隱藏了橫向的分隔線,這樣我們只能看到表格的列;而當(dāng)rules=none時(shí),縱向分隔線和橫向分隔線將全部隱藏。
          ­
          6.表格邊框的隱藏
          表格邊框的顯示與隱藏,是可以用frame參數(shù)來(lái)控制的。請(qǐng)注意它只控制表格的邊框圖,而不影晌單元格。
          只顯示上邊框 <table frame=above>
          只顯示下邊框 <table frame=below>
          只顯示左、右邊框 <table frame=vsides>
          只顯示上、下邊框 <table frame=hsides>
          只顯示左邊框 <table frame=lhs>
          只顯示右邊框 <table frame=rhs>
          不顯示任何邊框 <table frame=void>
          7.刷新的不同狀態(tài)
          ­
          非模態(tài)刷新父頁(yè)面:window.opener.location.reload();
          模態(tài)刷新父頁(yè)面:window.dialogArguments.location.reload();  
          window.location.assign('chklogin.jsp');
          window.location.reload('chklogin.jsp');
          以后用前者進(jìn)行刷新吧。后者似乎對(duì)FF 不怎么兼容。
          8.文字過(guò)長(zhǎng),縮略顯示為...
          <DIV STYLE="width: 120px; border: 1px solid blue;
          overflow: hidden; text-overflow:ellipsis">
          <NOBR title="就是比如有一行文字,很長(zhǎng),表格內(nèi)一行顯示不下.">就是比如有一行文字,很長(zhǎng),表格內(nèi)一行顯示不下.</NOBR>
          </DIV>
          9.加入收藏夾通用代碼
          ­
          <script type="text/javascript">
          function addBookmark(title,url)
          {
          if (window.sidebar)
          {
          window.sidebar.addPanel(title, url,"");
          } else if( document.all )
          {
          window.external.AddFavorite( url, title);
          } else if( window.opera && window.print )
          {
          return true;
          }
          }
          </script>
          頁(yè)面使用:<a href=javascript:addBookmark('天極網(wǎng)網(wǎng)頁(yè)陶吧','http://homepage.yesky.com/')> 添加到收藏</a>
          10.幾種彈出窗口
          用戶(hù)輸入:var msg=prompt("請(qǐng)輸入密碼:");if(msg == "PKU")  彈出輸入框。
          用戶(hù)確定:var IsOk = confirm('ok');
          警告:alert("對(duì)不起");
          open為打開(kāi)一個(gè)窗口。
          11.動(dòng)態(tài)改變 下拉列表的值。
          ­
          document.formname.elements[第幾個(gè)元素].text = "test";
          eg:
          document.test9_1.elements[0].options[0].text="昆明市";
          當(dāng)然也可以用,之所以寫(xiě)出來(lái)是因?yàn)楹芏鄷r(shí)候,我總是習(xí)慣用value,而忽略了text屬性:
          document.getElementById('select').options[0].text="昆明市";
          ­
          12.動(dòng)態(tài)插入表格內(nèi)容:
          document.getElementById('saleAndLost').rows[1].cells
          x[1].innerHTML="test";
          13.播放器代碼
          ­
          (1)media player代碼:
          <DIV>
          <OBJECT id=videowindow1 height=185 width=179 classid=CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6>
          <PARAM NAME="URL" VALUE="http://tyrb.com/big5/site1/images/2006-02/17/020203170937500170795.mp3">
          <PARAM NAME="playCount" VALUE="infinite">
          <PARAM NAME="autoStart" VALUE="1">
          <PARAM NAME="volume" VALUE="50">
          <PARAM NAME="uiMode" VALUE="full">
          <PARAM NAME="stretchToFit" VALUE="1">
          </OBJECT>
          </DIV>
          ­
          其中http://tyrb.com/big5/site1/images/2006-02/17/020203170937500170795.mp3就是歌曲"幸福像花兒一樣"的地址,
          改變這個(gè)地址也就改變了你的歌曲
          ­
          (2)WMP播放器
          <embed src="影音文件地址" width="播放器寬" height="播放器高" autostart="true" loop="true" align="center" volume="200" type="audio/x-pn-realaudio-plugin" exts="ra,ram" Init fn="load-types" mime-types="mime.types" ALT="(Random)"></embed>
          (3)Flash播放器
          <embed src="Flash地址" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="播放器寬" height="播放器高[" quality="High"></embed>
          ­
          (4)RealPlayer播放器
          <object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="480" height="360">
          <param name="src" value="dfA.rmvb" />
          <param name="controls" value="ImageWindow" />
          <param name="console" value="_master" />
          </object><br />
          <object classid="CLSID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA" width="480" height="32">
          <param name="src" value="dfA.rmvb" />
          <param name="controls" value="controlpanel" />
          <param name="AUTOSTART" value="1">
          <param name="console" value="_18c03c83e52df1f1285b0ac2d1ea7911" />
          </object>
          14.window.open參數(shù)詳解
          (1). 使用舉例:
             <SCRIPT   LANGUAGE="javascript">    
            <!--    
            window.open   ('page.html',   'newwindow',   'height=100,   width=400,   top=0,   left=0,   toolbar=no,   menubar=no,   scrollbars=no,resizable=no,location=no,   status=no')    
            //寫(xiě)成一行    
            -->    
            </SCRIPT>    
          (2). 參數(shù)詳細(xì)描述
            'page.html'   彈出窗口的文件名;    
            'newwindow'   彈出窗口的名字(不是文件名),非必須,可用空''代替;    
            height=100   窗口高度;    
            width=400   窗口寬度;    
            top=0   窗口距離屏幕上方的象素值;    
            left=0   窗口距離屏幕左側(cè)的象素值;    
            toolbar=no   是否顯示工具欄,yes為顯示;    
            menubar,scrollbars   表示菜單欄和滾動(dòng)欄。    
            resizable=no   是否允許改變窗口大小,yes為允許;    
            location=no   是否顯示地址欄,yes為允許;    
            status=no   是否顯示狀態(tài)欄內(nèi)的信息(通常是文件已經(jīng)打開(kāi)),yes為允許;  
            
          1 網(wǎng)頁(yè)中所有鏈接去除下劃線:
          <style type="text/css">
          <!--
          a:link {
          text-decoration: none;
          }
          a:visited {
          text-decoration: none;
          }
          a:hover {
          text-decoration: none;
          }
          a:active {
          text-decoration: none;
          }
          -->
          </style>
          2在當(dāng)前頁(yè)面定位
          <html>
          <head></head>
          <body>
          <a href="#first">one</a>
          <a href="#two">two</a>
          <a href="#three">three</a>
          <a name="first"><h1>one</h1>
          <p> firstfirstfirstfirst
          <br>
          <br><br><br><br><br><br><br><br><br><br><br><br>
          <br><br><br><br><br><br><br><br><br><br><br>
          firstfirstfirstfirstfirst
          </p><br/>
          <a name="two"><h1>two</h1>
          <p> twotwotwotwotwotwotwo
          <br><br><br><br><br><br><br><br><br><br><br><br>
          <br><br><br><br><br><br><br><br><br><br><br><br>
          twotwotwotwotwotwotwotwotwo
          </p><br/>
          <a name="three"><h1>three</h1>
          <p> threethreethreethreethree
          <br><br><br><br><br><br><br><br><br><br><br><br>
          <br><br><br><br><br><br><br><br><br><br><br>
          threethreethreethreethree
          <br>
          3   Frame
            <frameset cols="50,400">
          <frame src="div.html">
          <frame src="about:blank">
          </frameset>
          ////////////////////////////////////
          <html>
          <frameset rows="15%,*">
               <frame src="top.html" noresize>
               <frameset cols="30%,*">
                   <frame src="left.html" scrolling=yes>
                   <frame src="right1.html">
               </frameset>
              <noframes>
                  <body>
                      <p>你好啊</p>
                  </body>
              </noframes>
          </frameset>
          </html>
          4 自己寫(xiě)過(guò)的
          <%@ page language="java" pageEncoding="GBK"
          c%>
          <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean"
          prefix="bean"%>
          <%@ taglib uri="http://jakarta.apache.org/struts/tags-html"
          prefix="html"%>
          <html>
          <head>
            <title>JSP for RegisterForm form</title>
            <script language="javascript">
          <!--  
          function check()
          {  var name=document.ReForm.name.value;
              var pass=document.ReForm.password.value;
              var repass=document.ReForm.repassword.value;
              var email=document.ReForm.email.value;
          //驗(yàn)證數(shù)據(jù)的合法性
              if (!name||name.replace(/\s/g,"")=="")
              {  alert("用戶(hù)名不能為空或空格,請(qǐng)輸入用戶(hù)名!");
               ReForm.name.focus();
               return false;
              }
              if (!pass||pass.replace(/\s/g,"")=="")
              {
               alert("用戶(hù)密碼不能為空或空格,請(qǐng)輸入密碼!");
               ReForm.password.focus();
               return false;
              }
              if (!repass||repass.replace(/\s/g,"")=="")
              {   alert("用戶(hù)確認(rèn)密碼不能為空或空格,請(qǐng)輸入密碼!");
               ReForm.repassword.focus();
               return false;
              }
             if (pass != repass)
              {  alert("密碼與確認(rèn)密碼不同");
              ReForm.password.focus();
               return false;
          }
              if (!email||email.replace(/\s/g,"")=="")    
            {
             alert("請(qǐng)輸入Email且不能為空格!");
             ReForm.email.focus();
             return false;
            }
            if (!(email.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1))
            { alert("請(qǐng)輸入合法的Email!");
            ReForm.email.focus();
            return false;
            }  
          }
          //-->
          </script>
          </head>
          <body>
            <center>
             <html:form action="/register" method="post" focus="name">
             name : <html:text property="name" />
              <br />
             password : <html:password property="password" />
              <br />
             repassword : <html:password property="repassword" />
              <br />
             sex:<html:radio property="sex" value="1" >男</html:radio><html:radio property="sex" value="0">女</html:radio>
                <br />
             like:
                <html:multibox property="array" value="bc"></html:multibox>編程
                 <html:multibox property="array">lq</html:multibox>籃球<br/>
             email : <html:text property="email" />
              <br/>
              <html:submit >注冊(cè)</html:submit>
              <html:reset>取消</html:reset>
             </html:form>
            </center>
          </body>
          </html>
          5常用的正則表達(dá)式


          if(days.search("^[0-9]*[1-9][0-9]*$")!=0)
                      { 
                        alert("請(qǐng)輸入整數(shù)");
                        apply_HolidayForm.days.value="";
                        apply_HolidayForm.days.focus();
                        return false;
                   
                      }
          ^\d+$  //匹配非負(fù)整數(shù)(正整數(shù) + 0)
          ^[0-9]*[1-9][0-9]*$  //匹配正整數(shù)
          ^((-\d+)|(0+))$  //匹配非正整數(shù)(負(fù)整數(shù) + 0)
          ^-[0-9]*[1-9][0-9]*$  //匹配負(fù)整數(shù)
          ^-?\d+$    //匹配整數(shù)
          ^\d+(\.\d+)?$  //匹配非負(fù)浮點(diǎn)數(shù)(正浮點(diǎn)數(shù) + 0)
          ^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$  //匹配正浮點(diǎn)數(shù)
          ^((-\d+(\.\d+)?)|(0+(\.0+)?))$  //匹配非正浮點(diǎn)數(shù)(負(fù)浮點(diǎn)數(shù) + 0)
          ^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$  //匹配負(fù)浮點(diǎn)數(shù)
          ^(-?\d+)(\.\d+)?$  //匹配浮點(diǎn)數(shù)
          ^[A-Za-z]+$  //匹配由26個(gè)英文字母組成的字符串
          ^[A-Z]+$  //匹配由26個(gè)英文字母的大寫(xiě)組成的字符串
          ^[a-z]+$  //匹配由26個(gè)英文字母的小寫(xiě)組成的字符串
          ^[A-Za-z0-9]+$  //匹配由數(shù)字和26個(gè)英文字母組成的字符串
          ^\w+$  //匹配由數(shù)字、26個(gè)英文字母或者下劃線組成的字符串
          ^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$    //匹配email地址
          ^[a-zA-z]+://匹配(\w+(-\w+)*)(\.(\w+(-\w+)*))*(\?\S*)?$  //匹配url
          匹配中文字符的正則表達(dá)式: [\u4e00-\u9fa5]

          if(value.search("[\u4e00-\u9fa5]")==0){
                      alert("類(lèi)型名不能為中文!");
                   return false;
          }
          匹配雙字節(jié)字符(包括漢字在內(nèi)):[^\x00-\xff]
          匹配空行的正則表達(dá)式:\n[\s| ]*\r
          匹配HTML標(biāo)記的正則表達(dá)式:/<(.*)>.*<\/>|<(.*) \/>/
          匹配首尾空格的正則表達(dá)式:(^\s*)|(\s*$)
          匹配Email地址的正則表達(dá)式:\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
          匹配網(wǎng)址URL的正則表達(dá)式:^[a-zA-z]+://(\w+(-\w+)*)(\.(\w+(-\w+)*))*(\?\S*)?$
          匹配帳號(hào)是否合法(字母開(kāi)頭,允許5-16字節(jié),允許字母數(shù)字下劃線):^[a-zA-Z][a-zA-Z0-9_]{4,15}$
          匹配國(guó)內(nèi)電話號(hào)碼:(\d{3}-|\d{4}-)?(\d{8}|\d{7})?
          匹配騰訊QQ號(hào):^[1-9]*[1-9][0-9]*$
          下表是元字符及其在正則表達(dá)式上下文中的行為的一個(gè)完整列表:
          \ 將下一個(gè)字符標(biāo)記為一個(gè)特殊字符、或一個(gè)原義字符、或一個(gè)后向引用、或一個(gè)八進(jìn)制轉(zhuǎn)義符。
          ^ 匹配輸入字符串的開(kāi)始位置。如果設(shè)置了 RegExp 對(duì)象的Multiline 屬性,^ 也匹配 ’\n’ 或 ’\r’ 之后的位置。
          $ 匹配輸入字符串的結(jié)束位置。如果設(shè)置了 RegExp 對(duì)象的Multiline 屬性,$ 也匹配 ’\n’ 或 ’\r’ 之前的位置。
          * 匹配前面的子表達(dá)式零次或多次。
          + 匹配前面的子表達(dá)式一次或多次。+ 等價(jià)于 {1,}。
          ? 匹配前面的子表達(dá)式零次或一次。? 等價(jià)于 {0,1}。
          {n} n 是一個(gè)非負(fù)整數(shù),匹配確定的n 次。
          {n,} n 是一個(gè)非負(fù)整數(shù),至少匹配n 次。
          {n,m} m 和 n 均為非負(fù)整數(shù),其中n <= m。最少匹配 n 次且最多匹配 m 次。在逗號(hào)和兩個(gè)數(shù)之間不能有空格。
          ? 當(dāng)該字符緊跟在任何一個(gè)其他限制符 (*, +, ?, {n}, {n,}, {n,m}) 后面時(shí),匹配模式是非貪婪的。非貪婪模式盡可能少的匹配所搜索的字符串,而默認(rèn)的貪婪模式則盡可能多的匹配所搜索的字符串。
          . 匹配除 "\n" 之外的任何單個(gè)字符。要匹配包括 ’\n’ 在內(nèi)的任何字符,請(qǐng)使用象 ’[.\n]’ 的模式。
          (pattern) 匹配pattern 并獲取這一匹配。
          (?:pattern) 匹配pattern 但不獲取匹配結(jié)果,也就是說(shuō)這是一個(gè)非獲取匹配,不進(jìn)行存儲(chǔ)供以后使用。
          (?=pattern) 正向預(yù)查,在任何匹配 pattern 的字符串開(kāi)始處匹配查找字符串。這是一個(gè)非獲取匹配,也就是說(shuō),該匹配不需要獲取供以后使用。
          (?!pattern) 負(fù)向預(yù)查,與(?=pattern)作用相反
          x|y 匹配 x 或 y。
          [xyz] 字符集合。
          [^xyz] 負(fù)值字符集合。
          [a-z] 字符范圍,匹配指定范圍內(nèi)的任意字符。
          [^a-z] 負(fù)值字符范圍,匹配任何不在指定范圍內(nèi)的任意字符。
          \b 匹配一個(gè)單詞邊界,也就是指單詞和空格間的位置。
          \B 匹配非單詞邊界。
          \cx 匹配由x指明的控制字符。
          \d 匹配一個(gè)數(shù)字字符。等價(jià)于 [0-9]。
          \D 匹配一個(gè)非數(shù)字字符。等價(jià)于 [^0-9]。
          \f 匹配一個(gè)換頁(yè)符。等價(jià)于 \x0c 和 \cL。
          \n 匹配一個(gè)換行符。等價(jià)于 \x0a 和 \cJ。
          \r 匹配一個(gè)回車(chē)符。等價(jià)于 \x0d 和 \cM。
          \s 匹配任何空白字符,包括空格、制表符、換頁(yè)符等等。等價(jià)于[ \f\n\r\t\v]。
          \S 匹配任何非空白字符。等價(jià)于 [^ \f\n\r\t\v]。
          \t 匹配一個(gè)制表符。等價(jià)于 \x09 和 \cI。
          \v 匹配一個(gè)垂直制表符。等價(jià)于 \x0b 和 \cK。
          \w 匹配包括下劃線的任何單詞字符。等價(jià)于’[A-Za-z0-9_]’。
          \W 匹配任何非單詞字符。等價(jià)于 ’[^A-Za-z0-9_]’。
          \xn 匹配 n,其中 n 為十六進(jìn)制轉(zhuǎn)義值。十六進(jìn)制轉(zhuǎn)義值必須為確定的兩個(gè)數(shù)字長(zhǎng)。
          \num 匹配 num,其中num是一個(gè)正整數(shù)。對(duì)所獲取的匹配的引用。
          \n 標(biāo)識(shí)一個(gè)八進(jìn)制轉(zhuǎn)義值或一個(gè)后向引用。如果 \n 之前至少 n 個(gè)獲取的子表達(dá)式,則 n 為后向引用。否則,如果 n 為八進(jìn)制數(shù)字 (0-7),則 n 為一個(gè)八進(jìn)制轉(zhuǎn)義值。
          \nm 標(biāo)識(shí)一個(gè)八進(jìn)制轉(zhuǎn)義值或一個(gè)后向引用。如果 \nm 之前至少有is preceded by at least nm 個(gè)獲取得子表達(dá)式,則 nm 為后向引用。如果 \nm 之前至少有 n 個(gè)獲取,則 n 為一個(gè)后跟文字 m 的后向引用。如果前面的條件都不滿(mǎn)足,若 n 和 m 均為八進(jìn)制數(shù)字 (0-7),則 \nm 將匹配八進(jìn)制轉(zhuǎn)義值 nm。
          \nml 如果 n 為八進(jìn)制數(shù)字 (0-3),且 m 和 l 均為八進(jìn)制數(shù)字 (0-7),則匹配八
            
          posted on 2007-09-02 09:12 Crying 閱讀(659) 評(píng)論(10)  編輯  收藏 所屬分類(lèi): JavaScript和CSS

          FeedBack:
          # re: 網(wǎng)頁(yè)實(shí)用的
          2007-09-19 19:43 | Crying
          倒計(jì)時(shí)

          <Script Language="JavaScript">
             var timedate= new Date("October 1,2007");
             var times= "2010年國(guó)慶節(jié)";
             var now = new Date();
             var date = timedate.getTime() - now.getTime();
             var time = Math.floor(date / (1000 * 60 * 60 * 24));
             if (time >= 0)
             document.write( "現(xiàn)在離"+times+"還有: "+time +"天")
          </Script>
            回復(fù)  更多評(píng)論
            
          # re: 網(wǎng)頁(yè)實(shí)用的
          2007-09-19 19:45 | Crying
          重定向
          <html:submit onclick="javascript:window.location.href='userIpt.jsp'">返回</html:submit>
          //////////////////////////////////

          <html>
          <head>
          <title>錯(cuò)誤頁(yè)面</title>
          <script type="text/javascript">
          <!--
          function check(){

          form.action="log.jsp";
          }
          //-->
          </script>
          </head>

          <body bgcolor="#E0F0F8">
          <center>
          <form action="" name="form">
          對(duì)不起你 !無(wú)權(quán)訪問(wèn)!
          <br>
          <html:submit onclick="check()">返回</html:submit>
          </form>
          </center>
          </body>
          </html>
          /********刷新frame***********/

          window.parent.frames('leftFrame').document.location.reload();
          javascript:window.parent.frames('leftFrame').document.location.reload();  回復(fù)  更多評(píng)論
            
          # re: 網(wǎng)頁(yè)實(shí)用的
          2007-09-19 19:46 | Crying
          <head>

          <title>Untitled Document</title>

          <meta http-equiv="Content-Type" content="text/html; charset=gb2312">

          <SCRIPT LANGUAGE="JavaScript">

          <!--

          function formHandler(URL)
          {


          window.location.href = URL;

          }
          // -->


          </SCRIPT>

          </head>

          <FORM name = "form">

          <SELECT NAME="site" SIZE=1 onChange ="formHandler(this.value)">

          <option value="">連接到…. </option>

          <option value="http://www.ddvip.com">豆豆技術(shù)</option>

          <option value="http://soft.ddvip.net">豆豆軟件 </option>

          <option value="http://bbs.ddvip.net">豆豆論壇 </option>

          <option value="http://vip.ddvip.net">視頻在線 </option>

          <option value="http://soft.ddvip.net">豆豆軟件 </option>

          </SELECT>
          </FORM>
            回復(fù)  更多評(píng)論
            
          # re: 網(wǎng)頁(yè)實(shí)用的
          2007-09-19 19:48 | Crying
          退出
          1.。<html:submit onclick="javascript:window.close()">退出</html:submit>
          2.。<a href="javascript:window.close()">關(guān)閉</a>


          除去空格
          in Javascript:
          去掉leading/trailing 空格: str = str.replace(/^\s+|\s+$/g,"");
          去掉all空格: str = str.replace(/\s+/g,"");





            回復(fù)  更多評(píng)論
            
          # re: 網(wǎng)頁(yè)實(shí)用的
          2007-09-20 18:19 | Crying
          框架



          <frameset rows="21%,*">
          <frame src="aa.html" noresize>//noresize 是確定框架的大小固定且不能改變
          <frameset cols="20%,*">
          <frame src="bb.html" noresize>
          <frame src="bb.html" scrolling="yes" >//scrolling 是確定滾動(dòng)條是否對(duì)用戶(hù)有效,yes,no,auto
          </frameset>
          </frameset>  回復(fù)  更多評(píng)論
            
          # re: 網(wǎng)頁(yè)實(shí)用的
          2007-10-18 13:00 | Crying
          innerHTML 使用

          <html>
          <head>
          <style type="text/css" >

          span.bb{color :red}
          </style>
          <script type="text/javascript" language="javascript">
          function load()
          {
          alert("vv");
          document.getElementById("inner").innerHTML="成功";
          }
          </script>
          </head>
          <body onload="load()">
          <span class="bb" id="inner">你還沒(méi)輸入</span>
          </body>
          </html>  回復(fù)  更多評(píng)論
            
          # re: 網(wǎng)頁(yè)實(shí)用的
          2007-10-18 13:05 | Crying
          select使用 和用span改變字體 用li來(lái)代替<br/>
          <html>
          <head>
          <script language="javascript" type="text/javascript">
          function checkSelect(value)
          {
          alert(document.getElementById("Select1").value);
          alert(document.getElementById("Select1").options[document.getElementById("Select1").selectedIndex].text);
          alert(value);
          }

          </script>
          <link type="text/css" rel="stylesheet" href="myStyle.css"/>
          </head>
          <body>
          <div align="center"><img src="ww.jpg" width="98%" height="126"></div>
          </div>
          <select id="Select1" onChange="checkSelect(this.value)">
          <option value="00" selected>...</option>
          <option value="1">2001</option>
          <option value="2">2002</option>
          <option value="3">2003</option>
          <option value="4">2004</option>
          <option value="5">2005</option>
          <option value="6">2006</option>
          </select>
          <ul>
          <span>真的<span>|
          <span>假的</span>

          <li class="shu">vvv</li>
          <li><font color="blue">ddddddddd</font></li>

          <li><span> dddddddddd</span></li>
          </ul>
          <p><a href="#">連接的變化</a>
          <input name="dd" type="text" id="dd" onMouseOver=this.focus()>
          <input type="text" onmouseover=this.focus()>
          </p>

          </body>

          </html>
          /******************************************
          span{color:blue; font-size:24px}
          li{list-style:none}

          a:link{color:black; text-decoration:none}
          a:visited{color:red; text-decoration:none }
          a:hover{color:yellow ; text-decoration: none}
          a:active{color:red ; text-decoration:none}

          .shu{color: #33FF66}





            回復(fù)  更多評(píng)論
            
          # re: 網(wǎng)頁(yè)實(shí)用的[未登錄](méi)
          2007-11-20 10:15 | Crying
          打印

          <a href=javascript:window.print()>打 印</a>]  回復(fù)  更多評(píng)論
            
          # re: 網(wǎng)頁(yè)實(shí)用的
          2007-12-03 10:56 | Crying
          驗(yàn)證 IP

          function chk(){
          var ip= document.getElementById("v").value;

          if(!ip||ip.replace(/\s/g,"")=="")
          {
          alert("IP不能為空!");
          return false;
          }

          if (!(/^(\d{1,3})(\.\d{1,3}){3}$/.test(ip)))
          { alert("IP格式錯(cuò)誤!");
          return false;
          }
          for (var j=0;j<4;j++)
          { if (ip.split('.')[j]>255)
          { alert("IP中的一段或多段數(shù)字超出范圍!");
          return false;
          }
          }

          }
          </script>


          驗(yàn)證 三網(wǎng)段


          <script type="text/javascript">
          function chk(){
          var ip= document.getElementById("v").value;

          if(!ip||ip.replace(/\s/g,"")=="")
          {
          alert("網(wǎng)段不能為空!");
          return false;
          }

          if (!(/^(\d{1,3})(\.\d{1,3}){2}$/.test(ip)))
          { alert("網(wǎng)段格式錯(cuò)誤!");
          return false;
          }
          for (var j=0;j<3;j++)
          { if (ip.split('.')[j]>255)
          { alert("IP中的一段或多段數(shù)字超出范圍!");
          return false;
          }
          }

          }
          </script>  回復(fù)  更多評(píng)論
            
          # re: 網(wǎng)頁(yè)實(shí)用的
          2008-04-24 11:03 | Crying

          checkbox或者是radio 判斷選擇項(xiàng)



          function checkQuestions()
          {
          var dd=document.getElementsByName("question");
          var isSelected=false;
          var StrValue="";
          for(var i=0;i<dd.length;i++){
          if(dd[i].checked){
          isSelected=true;
          StrValue+=dd[i].value+",";
          }
          }
          if(!isSelected){
          alert('您沒(méi)選擇投票項(xiàng)!');
          }else{
          alert(StrValue);
          clearCheck();


          }
          }

          function clearCheck(){
          var dd=document.getElementsByName("question");
          for(var i=0;i<dd.length;i++){
          dd[i].checked=false;
          }
          }
            回復(fù)  更多評(píng)論
            
          主站蜘蛛池模板: 桑日县| 永靖县| 工布江达县| 桃园县| 鹤山市| 罗田县| 宣化县| 建始县| 新化县| 龙海市| 长春市| 葫芦岛市| 横峰县| 阿鲁科尔沁旗| 铁力市| 鹤山市| 格尔木市| 彭州市| 兴化市| 泽普县| 大冶市| 赤城县| 襄城县| 彭州市| 育儿| 桐乡市| 义马市| 商水县| 乌苏市| 凤山市| 通道| 侯马市| 兴国县| 龙门县| 常宁市| 永顺县| 缙云县| 任丘市| 龙川县| 连州市| 盘锦市|