ajax 註冊事件 頁面加載執行js事件


jsp 頁面

<div>
<li class="liexpand"></li>
<input id="ac-1" name="accordion-0" type="checkbox" style="display: none;" />
<label for="ac-1"  id ="title-1" class="containerlabel" >Car Database
      <img id="img-0" style="float:right;margin-right:10px;" src="../images/progress/common/add.png" />
   </label>
<article class="ac-large" id="accordion-content0"></article>
<li class="liclose"></li>
</div>


js 代碼

<script src="${pageContext.request.contextPath}/plugin/jquery/jquery-1.7.2.min.js"></script>
<script src="${pageContext.request.contextPath}/plugin/jquery/jquery-ui-1.8.20.custom.min.js"></script>


//註冊事件

   $(document).ready(function() {
        $("input[name='accordion-0']").attr("checked","checked");
        $("#img-0").attr('src','../images/progress/common/sub.png');
        var url = contextpath + "/market/showCar.action";
        //點擊加號 後加載 Car Database 錄入界面
        $("#accordion-content0").load(contextpath + "/market/showCar.action",{'sID':'${sID}'});
   });

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章