代码只适用于jsfiddle [英] Code only works on jsfiddle
问题描述
在中的代码时只是不起作用。
所以我从JSBin下载了源代码,打开了.html文件,我得到的是这样的:
有人可以解释我,为什么会发生这种情况吗? 解决方案
您在jQuery源代码链接中错过了 http:
。如果你使用在线资源
,你应该遵循 url的协议
。其他智能浏览器将从本地搜索。在这种情况下,你只是困惑你的浏览器...所以只有它发生......:D
你应该使用...
< script type ='text / javascript'src ='http://code.jquery.com/jquery-1.9.1.js'>< /脚本>
而不是
< script type ='text / javascript'src ='// code.jquery.com/jquery-1.9.1.js'></script>
In this question I asked, how I can generate shades of one color responsive to the number of div's. @DonJuwe came up with a perfectly working solution and demo: http://jsbin.com/xakifequ/1/edit
However when I'm trying to use the code from the jsfiddle or JSBin it just doesn't work. So I downloaded the source code from JSBin, opened the .html-file and what I got was this:
Can someone please explain me, why this happens?
you missed http:
in the jQuery source link. if you using online resource
you should follow the url's protocol
. Other wise browser will search it from local. in this way you just confused your browser... So only it happens... :D
you should use...
<script type='text/javascript' src='http://code.jquery.com/jquery-1.9.1.js'></script>
instead of
<script type='text/javascript' src='//code.jquery.com/jquery-1.9.1.js'></script>
这篇关于代码只适用于jsfiddle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!