熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> JSP教程 >> 正文

用JavaScript代碼給網頁熱鍵功能

2013-11-15 11:41:13  來源: JSP教程 

  <html>
<head>
<script language=javascript>
<!
function issueCommand(x){
    if (documentlayers)
    {
          if (xwhich==||xwhich==)
            windowclose();
        else if (eventkeyCode==||eventkeyCode==)
            selfprint();
        else if (eventkeyCode==||eventkeyCode==)
            alert(Sorry this is the only song in the List);
    }
    else if (documentall){
       
        if (eventkeyCode==||eventkeyCode==)
            windowclose();
        else if (eventkeyCode==||eventkeyCode==)
            selfprint();
        else if (eventkeyCode==||eventkeyCode==)
            alert(Sorry this is the only song in the List);
    }

  }

  //>
</script>
</head>

  <body>
<script language=javascript>
<!
if (documentlayers)
    documentcaptureEvents(EventKEYPRESS);

  documentonkeypress=issueCommand

  >
</script>

  <font size=><u>P</u>ress P</font><p>

  <font size=><u>N</u>ext One</font><p>

  <font size=><u>C</u>lose Window</font><p>
</body>
</html>


From:http://tw.wingwit.com/Article/program/Java/JSP/201311/19441.html
    推薦文章
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.