Conflicting JavaScripts...???

Please refrain from using "../../../" in your stuff, do "/" instead

So

../../../assets/scripts/prototype.js

would turn into

/assets/scripts/prototype.js

Assuming assets is in the root directory, if it's not, just do

/someotherdirectory/assets/prototype.js

So then when your code moves in directories, it doesn't break.

As for your problem. Use FireFox to check the same JavaScript error, (hit CTRL+Shift+J for the error console) IE loves not giving you the correct error message. However, I can see you using a lot of non-essential javascript libraries. prototype/scriptaculous/lightbox AND jQuery. jQuery has all of the previously mentioned abilities. So rather stick with one library to ensure that there's no direct conflict.... I think

@disclaimer blablablabla
 
jQuery Lightbox Plugin: http://leandrovieira.com/projects/jquery/lightbox/

In removing your extraneous javascript frameworks you removed whatever your lightbox script was using. By sticking with one framework you speed up the site, and standardise - however, you need to get plugins that replace the functionality the others were providing (in this case, lightbox).

Oh, and jquery.js is fine - remove the ?load=effects,builder bit.
 
Last edited:
Ok, you've got Firefox, now get Firebug. It's an addon for Firefox that'll streamline your debugging by a whole load.

BTW, $(function() { and $(document).ready(function() { mean the same thing. Take the uncommented line from the former and put it in the latter block.

For the record (while I'm on the topic of cleaning up), put your CSS before your javascript - particularly for jQuery, which may change the CSS properties.
 
Last edited:
For the record (while I'm on the topic of cleaning up), put your CSS before your javascript - particularly for jQuery, which may change the CSS properties.

Yup. It's an old standard that I've been following for yonks now. First link to CSS files, then link to client-side scripts and finally declare any ad-hoc scripts specific to the page. I prefer to put the scripts in a separate JS file though. Saves a wee bit of bandwidth and makes the page source appear cleaner.
 
Yup. It's an old standard that I've been following for yonks now. First link to CSS files, then link to client-side scripts and finally declare any ad-hoc scripts specific to the page. I prefer to put the scripts in a separate JS file though. Saves a wee bit of bandwidth and makes the page source appear cleaner.
... and can be used across multiple pages, and can be cached to enhance performance on subsequent calls.

Just thought I'd finish that for you. ;)
 
Ya well, even if it's a page-specific script, I like to include it in a separate JS file. That kinda cancels out the "used across multiple pages" bit though. Theoretically it can, but in practice it would be useless, seeing as it performs page-specific functions. I feel like I'm repeating myself here... "page-specific" probably already said it all. Man, 4 hours of sleep just isn't enough! :p
 
Thanx for all the help...! All this advise concerning these scriptings, etc...! Will play around with that java script until it works...! Thanx alot...!
 
Nope, reloaded - although I meant the page, not the script. :)

Oh yes, of course. Then it makes sense. Caching the JS file on the client is the best - if you have a 300kb JS file (GZipped through the transfer process, of course ;) ) then you only have to expend the odd 100kb (because it's GZipped) of bandwidth and 200ms of transfer time for the file once. Well, that is while the cache is still valid, of course.
 
Top
Sign up to the MyBroadband newsletter
X