JavaScript Uncaught ReferenceError only in Chrome
JavaScript Uncaught ReferenceError only in Chrome
我的朋友用GoDaddy.com的网站生成器建了一个网站,他让我给它添加一个简单的幻灯片。当涉及到JavaScript时,我几乎是一个新手,但我发现了一些代码,我可以修改它们来创建他想要的东西。(我发现的代码在这里:http://www.2createawebsites.com/image-slide-show-2.php)我修改的代码如下:
<script type="text/javascript" src="http://www.2createawebsites.com/resources/howtocreateawebsitefadeslide.js"></script>
<script type="text/javascript">
var mygallery = new fadeSlideShow({
wrapperid: "fadeshow2",
dimensions: [645, 300],
imagearray: [
["https://cache.nebula.phx3.secureserver.net/obj/NEI5NDhBRDJBODdCMzc5NzQwNkI6OWY4NjEzNjA4NWIxMjIwZWRiZDM3YjYxZDAxZWUyMTU=?uid=0eb2a385-f05b-4183-84fb-f593b956edfe", "https://appelbrassandwoodwind.com/Schedule_Repair.html", "_new"],
["https://cache.nebula.phx3.secureserver.net/obj/NEI5NDhBRDJBODdCMzc5NzQwNkI6Y2UzNTg1M2MwOWNlZTFlN2I3OTI4OWEwMDhlM2Y1YmU=?uid=4dcdb1ea-535a-45b3-9cdf-e449f7a6ffde", "https://appelbrassandwoodwind.com/Instrument_Purchase.html", "_new"],
["https://cache.nebula.phx3.secureserver.net/obj/NEI5NDhBRDJBODdCMzc5NzQwNkI6MWJlOWNmMjkzNzc0MmE4MGI3ODlhZGYyZWQyZmJjYjQ=?uid=f87212cc-b629-474f-a4a9-7f56de88c1fc", "https://appelbrassandwoodwind.com/Instrument_Rental.html", "_new"],
["https://cache.nebula.phx3.secureserver.net/obj/NEI5NDhBRDJBODdCMzc5NzQwNkI6MDY3OWRiNDU3Yzg0YzMxNjIxMGY0YjMwNDk4ZDcwZjE=?uid=ab991519-85e4-4a5e-aea4-d6448f0d6708", "https://appelbrassandwoodwind.com/Beginner_Layaway.html", "_new"],
["https://cache.nebula.phx3.secureserver.net/obj/NEI5NDhBRDJBODdCMzc5NzQwNkI6YmE1N2Q0YmE0Y2RlMjQzNjRiMDg4MGYwZWUwZDg5YmU=?uid=f8e39740-fe7b-4d3d-a371-b23a89056651", "https://appelbrassandwoodwind.com/Teacher_List.html", "_new"]
],
displaymode: {
type: 'auto',
pause: 2500,
cycles: 0,
wraparound: false
},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 1500, //transition duration (milliseconds)
descreveal: "ondemand",
togglerid: ""
})
</script>
<div id="fadeshow2"></div>
生成的幻灯片可以在(https://appelbrassandwoodwind.com/)的"主页"文本下方查看。这张幻灯片在IE、FireFox和Safari中都能完美运行,但在Chrome中就不行。当我在Chrome中点击F12并转到控制台时,我得到以下内容:Uncaught ReferenceError: fadeSlideShow未定义。我遵循脚本中的"src"路径,以确保在那里定义了fadeSlideShow函数,并且我确认了它。因此,我不明白为什么我得到这个错误,特别是因为其他浏览器按预期显示幻灯片。
我对这个问题进行了广泛的搜索,虽然我发现其他人也有这个问题,但要么没有提供解决方案,要么提供的解决方案远远超出我的理解。如有任何帮助,我将不胜感激。
谢谢!
我还得到了这个警告:
[blocked] The page at https://appelbrassandwoodwind.com/ ran insecure content from http://www.2createawebsites.com/resources/howtocreateawebsitefadeslide.js.
因为你的页面是用"https"请求的,但你用"http"包含资源。尝试将您的<script>
更改为:
<script type="text/javascript" src="//www.2createawebsites.com/resources/howtocreateawebsitefadeslide.js"></script>
注意缺少"http:"。这将使用与您的页面相同的协议请求外部资源。
以下是关于无协议url的一些信息:
- 我可以改变我所有的http://链接只是//?
- 在
相关文章:
- window.opener not working in chrome & IE
- requestAnimFrame 60FPS in Chrome, 1FPS in FF
- history.pushState in Chrome make favicon request
- jquery append in chrome
- javascript self.close() in chrome
- XMLHTTPRequest resulting in Aw, snap in chrome
- Canvas Bug in Chrome
- ERR_NAME_NOT_RESOLVED in Chrome
- document.getElementById().value return undefined in chrome
- event.dataTransfer.dropEffect in chrome
- net::ERR CONTENT LENGTH MISMATCH in Chrome with Jboss WildFl
- window.open as tabs not pop ups in Chrome
- Firefox Bookmarklet in Chrome
- Ruby Time to JavaScript Date in Chrome/Firefox
- Using onafterprint in Chrome & Safari
- Weird behavior in chrome's javascript .width property
- document.getElementById in chrome
- KeyboardEvent in Chrome, keyCode is 0
- Thickbox - Won't close in Chrome
- Pop-unders in Chrome Canary 29?