jQuery 在不同的虚拟主机上不起作用

我刚刚完成了一个网站 &去上传它到客户的主机,这是我用于我的个人网站的同一台主机.当我将网站作为附加组件上传到他的域时测试了jQuery函数,它没有运行.我正在通过以下方式从 Google 加载 jQuery:

I just finished a website & went to upload it to the client's host, which is the same host that I use for my personal site. When I uploaded the site to his domain as an add on & tested the jQuery function, it doesn't run. I'm loading jQuery from Google via:

<!--/ jQuery Inclusion-->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>

它在我的个人主机设置上完美运行,只是在新主机上根本无法运行.我打电话给 &没有得到技术支持的解决,希望你们能帮助我.

And it runs perfectly on my personal host setup, it just doesn't work at all on the new host. I called & got no resolve from tech support, was hoping that you guys could help me out.

Nivo 滑块和Fancybox 在我的个人网站上运行:

http://tinyurl.com/d3zley7


Nivo 滑块和Fancybox 无法在客户的网站上运行:

http://tinyurl.com/d2egv2v

考虑到不需要将 js 托管在服务器上,可能导致这种情况的原因是什么?非常感谢您的帮助!

What could be causing this considering it's not required that the js is hosted on the server? I greatly appreciate your help!

推荐答案

不是 jQuery 问题或其他问题,是因为您的所有脚本引用都返回 404找不到页面"

Is not a jQuery issue or whatsoever, is because all your scripts references return a 404 "page not found"

您的引用从 root / 文件开始

Your references start from the root / file

<script src="/nivo-slider/jquery.nivo.slider.js" type="text/javascript"></script>
<script src="/nivo-slider/jquery.nivo.slider.pack.js" type="text/javascript"></script>

<!--/ Fancybox Script-->
<script type="text/javascript" src="/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<script type="text/javascript" src="/fancybox/jquery.easing-1.4.pack.js"></script>

...etc

.... 但它们应该是相对于目录 nd/

.... but they should be relative to directory nd/ like

<script src="nd/nivo-slider/jquery.nivo.slider.js" type="text/javascript"></script>

... etc

...路径问题也是如此;)

... so is a path issue ;)

相关文章