I have looked at similar threads but have yet to find a solution to this problem.
The website is working perfectly on my local machine (Mac), but I have uploaded a website via FTP (hosted by 1&1) and when I view the site in the browser (latest Chrome/Firefox/Safari) the scripts are not loading for the image slider (AnythingSlider).
View the website
Apologies if this is answered elsewhere.
I have looked at similar threads but have yet to find a solution to this problem.
The website is working perfectly on my local machine (Mac), but I have uploaded a website via FTP (hosted by 1&1) and when I view the site in the browser (latest Chrome/Firefox/Safari) the scripts are not loading for the image slider (AnythingSlider).
View the website
Apologies if this is answered elsewhere.
Share Improve this question asked May 18, 2012 at 10:09 AudityAudity 493 silver badges11 bronze badges 4- You have 3 JS errors on your site. Check the console. – antyrat Commented May 18, 2012 at 10:10
- Why do you use this? <script>window.jQuery || document.write('<script src="js/libs/jquery-1.7.2.min.js"><\/script>')</script> – Johntor Commented May 18, 2012 at 10:17
- 1 you haven't created the dom ready event... use defer option in script block... your code will run after all the js files loaded from the server – Dasarp Commented May 18, 2012 at 10:17
- I agre with Dasarp, because you paths are ok, i checked and i also ave the error on anythingslider... but when i copy that js source (anythingslider) and paste it ok console the it runs ok and i have anythingslider working, therefor it must be some resource that the js uses and is not loaded yet – neu-rah Commented May 18, 2012 at 10:30
4 Answers
Reset to default 4Checking your script you have the following error:
Uncaught TypeError: Object [object Object] has no method 'anythingSlider'
You need to remove your second jQuery call:
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.7.2.min.js"><\/script>')</script>
This will prevent jQuery from "restarting", which will prevent you from losing the anythingSlider
function.
line 155 :
<script src="//ajax.googleapis./ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.7.2.min.js"><\/script>')</script>
line 20:
<script src="js/libs/jquery-1.7.2.min.js"></script>
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.7.2.min.js"><\/script>')</script>
Don't include jQuery twice. The jquery on line 155 is being included after anythingslider. So it is resetting the jquery object ( It no longer has anythinslider). remove this line 155 jquery and change line 34 like this
<script>
$(document).ready(function(){
$('#slider').anythingSlider();
});
</script>
*DUDE! what are you doing with ur scripts and css*
1.i agree with curt.
there are 4 places where you have included jquery and not evenywhere there is a check for existing jquery availability.
2.i have checked all your script files are loading correctly. so the problem isnt of loading the files. with it you are using incorrect urls to load you script.
3.finally you should use $(document).ready() event for anything tht needs to be executed after dom ready
Try this code
<script defer type="text/javascript">
// DOM Ready
$(document).ready(function () {
$('#slider').anythingSlider();
});
</script>