javasript:首碼 與 事件處理常式的邦定

來源:互聯網
上載者:User
在IE中預設的都是vbsricpt的,所有javascript的都要加javasript:首碼,要不就報錯<td style="text-align:right;height:27px" valign="top"
           colspan="6">
           <input class="short_button_style"
            onClick="
             javaScript:
             if ( document.getElementById('confirmFlg').value == '1' ) {
              var n = showSaveConfirmMessage();
              if (n == 1) {
               document.applicationListForm.insertAction.value = '1';
               document.applicationListForm.menuId.value = '222';
               document.applicationListForm.submit();
               return false;
              }
              if (n == 2) {
               showDialog();
              }
              if (n == 3) {
               return false;
              }
             }
             showDialog();
             "
            type="button" value="印刷" tabindex="6">
          </td> 《征服 Ajax ---Web 2.0 開發技術詳解》 P/107 說,通常情況下,在JavaScript中可以使用兩種形式將事件處理常式邦定到特定的事件中,分別是嵌入HTML標記以及使用對象的事件屬性和attachEvent()方法。通常事件處理常式並不會這麼簡單,而會包括多行JavaScript代碼,但如果把所有的處理常式都放在onclick屬性中(語句間只能用分號隔開,不能換行)。<  但如上之例,可以換行啊> <td colspan="2"
           style="text-align:left;vertical-align:bottom;font-weight:bold;">
           <a tabindex="8"
           style="color: blue;"
           href="
            javaScript:
            document.applicationListForm.searchAction.value = 'theDayAfterTomorrow';
            addOpePlanDay('2');
            document.applicationListForm.submit();
            ">
           翌々日未準備件數
            
           <c:out value="${applicationList.afterTomorrowNoreadyCount}" />
           件
           </a>
          </td> 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.