2011年9月28日

          執行./startup.sh,或者./shutdown.sh的時候,爆出了Permission denied

          關于LINUX權限-bash: ./startup.sh: Permission denied

          <script type="text/javascript"></script><script type="text/javascript"></script>

          在執行./startup.sh,或者./shutdown.sh的時候,爆出了Permission denied,

          其實很簡單,就是今天在執行tomcat的時候,用戶沒有權限,而導致無法執行,

          用命令chmod 修改一下bin目錄下的.sh權限就可以了

          如chmod u+x *.sh

          在此執行,OK了。

          posted @ 2014-12-30 10:26 liujg 閱讀(292) | 評論 (0)編輯 收藏

          submit()和onsubmit()的區別(轉)

          2011-03-16 10:34

          最近在開發中遇到了表單提交前驗證的問題,用一個普通的button按鈕代替submit按鈕,
          在提交前觸發這個button的onclick事件,在其事件中觸發form的submit事件。問題出現了:
          以下是出現相關代碼:
          <form action="http://www.baidu.com/s?wd=this.form.submit%28%29%3B&cl=3" method="post" name="form1" onsubmit="return alert('已提交!'); return false;"> 
              <table align="center" width="420px" cellPadding="2" cellSpacing="1" bgcolor="#A4B6D7"    style="word-wrap:Break-word;">                
                  <tr style="cursor: hand;background:#d7e3f6" > 
                      <td width="20%" align="right">條型碼</td> 
                      <td><input style="width:90%" type="text" name="GOODSNUM"   size="30"  maxlength="8" ></td> 
                  </tr> 
                  <tr> 
                      <td align="center" colspan="2"> 
                          <input type="button" name="save" value="保存" onclick="if((confirm('確定要提交嗎?'))) this.form.submit();"/> 
                      </td> 
                  </tr>  
              </table> 
          </form> 


          卻發現并沒有觸發form的onsubmit方法,而是直接提交了。奇怪了,難道沒有這種方式無法結合form的onsubmit方法嗎?
          仔細想了想,既然this.form表示form這個對象,那么肯定能獲取到form的屬性和方法的
          ,就改成this.form.onsubmit();  成功!
          我又查了查手冊,原來submit的方法是這樣解釋的:
            The submit method does not invoke the onsubmit event handler. Call the onsubmit event handler directly. When using Microsoft® Internet Explorer 5.5 and later, you can call the fireEvent method with a value of onsubmit in the sEvent parameter.

          意思是說submit這個方法是不觸發onsubmit時間的,如果想要觸發它,需要調用
          fireEvent方法。嘗試一下:this.form.fireEvent('onsubmit');哈哈,果然也成功!不過這樣不是多此一舉嗎?呵呵!

          就這個小問題也搞了我將近一個小時,不過為了以后不為這個問題煩惱,這也是值得的。
          this.form.submit(); //直接提交表單
          this.form.onsubmit(); //調用form的onsubmit方法
          this.form.fireEvent('onsubmit'); //同上,
               PS:又學到了fireEvent這個方法,

          2.onsubmit()與submit() :

          <sCript>
          funCtion fun()
          {
             alert("form_submit");
          }
          </sCript>

          <form onsubmit="fun()">
          <input type="submit" id="aaa" value="submit">   <!--能彈出form_submit-->
          <input type="button" id="bbb" value="onCliCk_submit" onCliCk="doCument.forms[0].submit()">
          <!--
          表單會提交,但是不會運行fun() 原因是 onsubmit事件不能通過此種方式觸發(在IE環境)
          直接用腳本doCumetn.formName.submit()提交表單是不會觸發表單的onsubmit()事件的
          -->
              <input type="button" id="bb1" value="onCliCk_onsubmit" onCliCk="doCument.forms[0].onsubmit()">

          <!--會觸發fun()參數-->
          </form>

          posted @ 2011-09-28 15:11 liujg 閱讀(350) | 評論 (0)編輯 收藏

          <2011年9月>
          28293031123
          45678910
          11121314151617
          18192021222324
          2526272829301
          2345678

          導航

          統計

          常用鏈接

          留言簿(1)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          相冊

          收藏夾

          boddiy

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 南宁市| 吉林市| 五峰| 旌德县| 宁化县| 英超| 吕梁市| 谢通门县| 南川市| 南和县| 昌都县| 商河县| 麦盖提县| 曲沃县| 巴南区| 陆良县| 永吉县| 房山区| 金湖县| 恩施市| 微山县| 灌云县| 青州市| 安义县| 永安市| 农安县| 延川县| 万山特区| 麟游县| 田阳县| 宝鸡市| 延津县| 黑山县| 武隆县| 沙河市| 阳西县| 永仁县| 克山县| 蕉岭县| 台北市| 东兴市|