Refresh DOM with jquery after AJAX call

前端 未结 2 1980
面向向阳花
面向向阳花 2021-01-15 02:04

I\'m working on a new project http://www.hotwirerevealed.com which reveals / identifies hotels on hotwire.com. After inputting a state and a destination I have a javascript

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-15 02:33

    The quickest way I'd do it is to add the livequery plugin to the page,
    and then instead of your:

    $(document).ready(function(){
      $(".hotel").fancybox({
            'width'             : '75%',
            'height'            : '75%',
            'type'              : 'iframe'
      });
    });
    

    do this:

    $(document).ready(function(){
      $(".hotel").livequery(function(){
        $(this).fancybox({
            'width'             : '75%',
            'height'            : '75%',
            'type'              : 'iframe'
          });
      });
    });
    

提交回复
热议问题