Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2009-05-04 19:11:36
- dreamer
- Member
- Registered: 2007-06-08
- Posts: 242
[resolved] jquery plugin works on one part of the site but the other
On my site, I can’t figure out why my jquery plugin for rotating pics and the photo gallery in the footer work on some pages (such as the homepage) but won’t work for other pages such as a contact page;
I’ve stored all the javascript code into the appropriate forms and all page templates are calling from the appropriate forms.
Offline
Re: [resolved] jquery plugin works on one part of the site but the other
It’s just a problem of relative (wrong) URLs to your JS files.
You have:
<script src="/js/rotating/jquery-1.2.6.min.js" type="text/javascript"></script>
<script src="/js/rotating/jquery.cycle.min.js" type="text/javascript"></script>
<script src="js/rotating/common.js" type="text/javascript"></script>
The first two are OK (they are absolute to the site root). The other one is missing the slash /
, so it’s working as a relative URL. So, when browser asks for common.js file, it asks to look for it on the wrong place, so you get a 404 for that file.
A tip: install Firebug extension, enable the Net panel for your site, then look on the Net tab. Every red line is a missing file (404).
Last edited by maniqui (2009-05-04 19:30:22)
Offline