本帖最后由 sky94132003 于 2014-12-11 17:58:13 编辑

解决方案 »

  1.   

    放atts.php里 jQuery(document).ready(function(){ 这句去掉
    放admin.php 里用 
     $(".deleteitem").on('click',function(){
      var parent = $(this).closest('li');
      var id = parent.attr('id');
          $.ajax({
            type: "POST",
            data: "id=" +id,
            URL: "atts.php",
            success: function(msg){
              $('#'+id).remove();
            }
          });
      });
      

  2.   


    先谢谢,把你这段加入了admin.php
    atts.php 列表模板格式
    <li id="005627_48.jpg">
    <img src="xxxx" alt="xxxxxx" onclick="insertHtml()">
    <button class="deleteitem"><i class="icon-remove"></button>
    </li>点击了没有引起jq反应
      

  3.   

    ($.fn.on||$.fn.live).call($(".deleteitem"),'click',function(){alert(1);
      var parent = $(this).closest('li');
      var id = parent.attr('id');
          $.ajax({
            type: "POST",
            data: "id=" +id,
            URL: "atts.php",
            success: function(msg){
              $('#'+id).remove();
            }
          });
      });放在admin.php里
      

  4.   


    打开firebug
    没有引起atts.php但页面上其他JQ正常运作中