Yepnope - 加载桌面文件但不加载移动文件

时间:2014-08-20 13:46:03

标签: javascript yepnope

我做错了但是无法弄清楚桌面脚本的第一部分是什么工作并加载我想要的脚本但是当我在移动设备上测试时,没有任何移动脚本被加载!有人可以指出我做错了什么。

由于

  <script src="/medias/custom-content/js/yepnope.1.5.4-min.js"></script>
  <script src="/medias/custom-content/js/categorizr.min.js"></script>

  <script>
  $(document).ready(function(){

  yepnope([{
    test: categorizr.isDesktop,
    yep: ['http://cdnjs.cloudflare.com/ajax/libs/jcarousel/0.3.0/jquery.jcarousel.min.js','/medias/custom-content/microsites/2014/event10/simple-sleek/desktop_carousel.js','/medias/custom-content/js/getjson.js'],
    complete: function() {
      for (i=1; i<=8; i++) {
              returnDetails("#item"+i);
      }
    }
  },
  {
    test: categorizr.isMobile,
    yep: ['/_ui/mobile/common/js/jquery.carouFredSel-6.2.1-packed.js','/medias/custom-content/microsites/2014/event10/simple-sleek/mobile_carousel.js','/medias/custom-content/js/getjson_mobile.js'],
    complete: function() {
      for (i=1; i<=8; i++) {
              returnDetails("#item"+i);
      }
    }
  }
  ]);

  });

  </script>

这是有效的脚本: -

  <script src="/medias/custom-content/js/yepnope.1.5.4-min.js"></script>
  <script src="/medias/custom-content/js/categorizr.min.js"></script>

  <script>
  $(document).ready(function(){

  yepnope([{
    test: categorizr.isDesktop,
    yep: ['http://cdnjs.cloudflare.com/ajax/libs/jcarousel/0.3.0/jquery.jcarousel.min.js','/medias/custom-content/microsites/2014/event10/simple-sleek/desktop_carousel.js','/medias/custom-content/js/getjson.js'],
    nope: ['/_ui/mobile/common/js/jquery.carouFredSel-6.2.1-packed.js','/medias/custom-content/microsites/2014/event10/simple-sleek/mobile_carousel.js','/medias/custom-content/js/getjson_mobile.js'],
    complete: function() {
      for (i=1; i<=8; i++) {
              returnDetails("#item"+i);
      }
    }
  },
  ]);

  });

  </script>

0 个答案:

没有答案