douping3860 2017-03-28 17:50
浏览 139
已采纳

在jquery自动刷新后,div弹出窗口无效

I have a jquery which refreshes the div but after refresh the popup doesn't work from the refreshed data.

<script type="text/javascript">
    $(function() {
        $.ajaxSetup ({
            cache: false
        });
        //Refresh trigger `#newORDERx`
        var auto_refreshes = setInterval(function () {$('#newORDERx').load('inc/restAdmin_orders_rcvz.php');}, 1000);
    });
</script>
<div id="newORDERx"></div>

When i use it like below then popup works fine but then it doesn't refresh the div.

<script type="text/javascript">
    $(document).ready(function(){
        $.ajaxSetup ({
            cache: false
            mainClass: 'pp-product-detail' // when i use this then popup works but then doesn't refresh the div
        });
        var auto_refreshes = setInterval(function () {$('#newORDERx').load('inc/restAdmin_orders_rcvz.php');}, 1000);
    });

</script>

pp-product-detail class

AJAX popup

if ($('.pp-product-detail').length) {
   $('.pp-product-detail').magnificPopup({
       type: 'ajax'
   });
}

restAdmin_orders_rcvz.php

<div class="col-lg-6">
  <div class="the-menu-item">
    <div class="image-wrap">
      <a class="pp-product-detail" href="product-detail-popup-rest-admin-order-rcv.php?iid=<?php echo $phporder; ?>">
      <img src="images/themenu/img-1.jpg" alt="">
      </a>
    </div>
    <div class="the-menu-body">
      <b><font color='red'> Order # </font> <?php echo $phporder; ?><br>
      <font color='red'> Items Included : </font> <?php echo $lrsa['count']; ?>
      <br><font color='red'>Dated : </font> <?php echo date("d/m/Y", strtotime($phpdates)); ?>
      </b>
    </div>
  </div>
</div>
  • 写回答

2条回答 默认 最新

  • dqblm40280 2017-04-01 16:19
    关注

    I have just added following file in restAdmin_orders_rcvz.php and its working fine.

    <script type="text/javascript" src="js/scripts.js"></script>
    

    restAdmin_orders_rcvz.php

    <div class="col-lg-6">
      <div class="the-menu-item">
        <div class="image-wrap">
          <a class="pp-product-detail" href="product-detail-popup-rest-admin-order-rcv.php?iid=<?php echo $phporder; ?>">
          <img src="images/themenu/img-1.jpg" alt="">
          </a>
        </div>
        <div class="the-menu-body">
          <b><font color='red'> Order # </font> <?php echo $phporder; ?><br>
          <font color='red'> Items Included : </font> <?php echo $lrsa['count']; ?>
          <br><font color='red'>Dated : </font> <?php echo date("d/m/Y", strtotime($phpdates)); ?>
          </b>
        </div>
      </div>
    </div>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持