jQuery isn't functioning on different webhost

倾然丶 夕夏残阳落幕 提交于 2020-01-06 18:08:39

问题


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 Slider & Fancybox working on my personal site:

http://tinyurl.com/d3zley7


Nivo Slider & Fancybox NOT working on client's site:

http://tinyurl.com/d2egv2v

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


回答1:


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

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

.... 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 ;)




回答2:


nivoslider javascript does not exist on your clients site:

http://greencertifier.com/nivo-slider/jquery.nivo.slider.js

but it exists on your site:

http://helmblanc.com/nivo-slider/jquery.nivo.slider.js



来源:https://stackoverflow.com/questions/13391926/jquery-isnt-functioning-on-different-webhost

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!