问题
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