海之蓝心 2018-03-05 12:10 采纳率: 33.3%
浏览 1880
已采纳

pxloader.js 的baseUrl里的地址到底应该怎么填啊

GET http://localhost/H5/Hiruscar/Mon%20Mar%2005%202018%2020:09:30%20GMT+0800%20(%E4%B8%AD%E5%9B%BD%E6%A0%87%E5%87%86%E6%97%B6%E9%97%B4)&i=89 404 (Not Found)
一直出现以上的报错

这是我的写法,是不是baseUrl写错了?

var baseUrl = 'http://localhost/H5/Hiruscar' + new Date,
$log = $('.swiper-container').val(''),
$progress = $('.swiper-container').text('0 / 100'),
loader = new PxLoader();

// add 100 images to the queue
for(var i=0; i < 100; i++) {
// this time we'll create a PxLoaderImage instance instead of just
// giving the loader the image url
var pxImage = new PxLoaderImage(baseUrl + '&i=' + i);

        // we can add our own properties for later use
        pxImage.imageNumber = i + 1;

        loader.add(pxImage);
    }

// callback that runs every time an image loads
loader.addProgressListener(function(e) {

        // log which image completed
        $log.val($log.val() + 'Image ' + e.resource.imageNumber + ' Loaded\r');

        // scroll to the bottom of the log
        $log.scrollTop($log[0].scrollHeight);

        // the event provides stats on the number of completed items
        $progress.text(e.completedCount + ' / ' + e.totalCount);
    });

    loader.start();
  • 写回答

2条回答 默认 最新

  • Go 旅城通票 2018-03-05 12:58
    关注

    少了问好了吧,要变为参数,要不就是路径了

     var baseUrl = 'http://localhost/H5/Hiruscar?' + new Date,
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容