首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >Javascript幻灯片不工作;在本地工作,但在上传时不工作

Javascript幻灯片不工作;在本地工作,但在上传时不工作
EN

Stack Overflow用户
提问于 2013-10-14 02:22:38
回答 2查看 672关注 0票数 0

正如标题所暗示的,幻灯片在本地工作,但在上传到服务器时不起作用。

该网站为http://cmp.physics.iastate.edu/esl/photos.html

幻灯片代码为:

代码语言:javascript
代码运行次数:0
运行
复制
<script type="text/javascript">
<!-->
    var image1=new Image()
    image1.src="images/ESL Keep/Thumbnails/IMG_2509.jpg"
    var image2=new Image()
    image2.src="images/ESL Keep/Thumbnails/IMG_2510.jpg"
    var image3=new Image()
    image3.src="images/ESL Keep/Thumbnails/IMG_2518.jpg"
    var image4=new Image()
    image4.src="images/ESL Keep/Thumbnails/IMG_2536.jpg"
    var image5=new Image()
    image5.src="images/ESL Keep/Thumbnails/IMG_2537.jpg"
    var image6=new Image()
    image6.src="images/ESL Keep/Thumbnails/IMG_2537.jpg"
    var image7=new Image()
    image7.src="images/ESL Keep/Thumbnails/IMG_2543.jpg"
//-->
</script>
<img src="images/ESL Keep/Thumbnails/IMG_2509.jpg" name="slide" width="450" height="300"/>
<script type="text/javascript">
<!--
    var step=1
    function slideit(){
        document.images.slide.src=eval("image"+step+".src")
        if(step<6)
            step++
        else
            step=1
        setTimeout("slideit()",3000)
    }
    slideit();
//-->
</script>

有没有人知道为什么它不能工作?

任何帮助都是非常感谢的。谢谢。

EN

回答 2

Stack Overflow用户

发布于 2013-10-14 02:48:35

您的照片丢失请参阅网站错误:

代码语言:javascript
代码运行次数:0
运行
复制
Failed to load resource: the server responded with a status of 404 (Not Found) http://cmp.physics.iastate.edu/esl/images/ESL%20Keep/Thumbnails/IMG_2509.jpg
Failed to load resource: the server responded with a status of 404 (Not Found) http://cmp.physics.iastate.edu/esl/images/ESL%20Keep/Thumbnails/IMG_2510.jpg
Failed to load resource: the server responded with a status of 404 (Not Found) http://cmp.physics.iastate.edu/esl/images/ESL%20Keep/Thumbnails/IMG_2518.jpg
Failed to load resource: the server responded with a status of 404 (Not Found) http://cmp.physics.iastate.edu/esl/images/ESL%20Keep/Thumbnails/IMG_2536.jpg
Failed to load resource: the server responded with a status of 404 (Not Found) http://cmp.physics.iastate.edu/esl/images/ESL%20Keep/Thumbnails/IMG_2537.jpg
Failed to load resource: the server responded with a status of 404 (Not Found) http://cmp.physics.iastate.edu/esl/images/ESL%20Keep/Thumbnails/IMG_2543.jpg
GET http://cmp.physics.iastate.edu/esl/images/ESL%20Keep/Thumbnails/IMG_2510.jpg 404 (Not Found) photos.html:78
GET http://cmp.physics.iastate.edu/esl/images/ESL%20Keep/Thumbnails/IMG_2518.jpg 404 (Not Found) photos.html:78
GET http://cmp.physics.iastate.edu/esl/images/ESL%20Keep/Thumbnails/IMG_2536.jpg 404 (Not Found) photos.html:78
GET http://cmp.physics.iastate.edu/esl/images/ESL%20Keep/Thumbnails/IMG_2537.jpg 404 (Not Found) photos.html:78
GET http://cmp.physics.iastate.edu/esl/images/ESL%20Keep/Thumbnails/IMG_2537.jpg 404 (Not Found) photos.html:78
GET http://cmp.physics.iastate.edu/esl/images/ESL%20Keep/Thumbnails/IMG_2509.jpg 404 (Not Found) photos.html:78
GET http://cmp.physics.iastate.edu/esl/images/ESL%20Keep/Thumbnails/IMG_2510.jpg 404 (Not Found) photos.html:78
GET http://cmp.physics.iastate.edu/esl/images/ESL%20Keep/Thumbnails/IMG_2518.jpg 404 (Not Found) photos.html:78
GET http://cmp.physics.iastate.edu/esl/images/ESL%20Keep/Thumbnails/IMG_2536.jpg 404 (Not Found) photos.html:78
GET http://cmp.physics.iastate.edu/esl/images/ESL%20Keep/Thumbnails/IMG_2537.jpg 404 (Not Found) photos.html:78

确保您的图片位于显示图像的正确位置。

我在Console feature in Google Chrome上找到了这个,我建议你用它来开发和测试站点。

票数 0
EN

Stack Overflow用户

发布于 2017-04-05 23:05:45

检查body标记中包含的javascript源文件,可能包含两个jquery文件。我也遇到了这个问题,它在我的本地主机上工作,但在活动服务器上不起作用,然后我删除了第二个qquery包含,它开始工作。

我希望这能行得通

示例:

代码语言:javascript
代码运行次数:0
运行
复制
<body>
    <script type="text/javascript" src="js/jquery-2.1.4.min.js"></script>
    <script type="text/javascript" src="js/jquery-1.1.0.min.js"></script>
    <!--find the second jquery file and remove it-->
    </body
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19348641

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档