Is it possible to have 2 javascripts in the "head" tags? When I put them in both my scripts stop working. I have 2 scripts to run on a specific page..... 1. Slideshow for the top 2. Image viewer for photos You can see an example here... http://trentonems.com/staff.php of it not allowing the sideshow to start (just hangs up at first photo) and the thumbnail viewer is not opening up the thumbnails properly into their full size Here is the code I am using <head> <title>Trenton EMS</title> <meta name="Description" content="Trenton Emergency Medical Service is located in the Capital City of Trenton in NJ and provides emergency medical care to the residents and visitors to the city of Trenton"> <meta name="KeyWords" content="tems,trenton,emergency,medical,service,ems,nj,new jersey"> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="css/style.css" /> <link rel="stylesheet" href="image_viewer/lightbox.css" type="text/css" media="screen" /> <script type="text/javascript" src="image_viewer/js/prototype.js"></script> <script type="text/javascript" src="image_viewer/js/scriptaculous.js?load=effects"></script> <script type="text/javascript" src="image_viewer/js/lightbox.js"></script> <script type="text/javascript" src="js/jquery.min.js"></script> <script type="text/javascript" src="js/jquery.easing.min.js"></script> <script type="text/javascript" src="js/jquery.nivo.slider.pack.js"></script> <script type="text/javascript"> $(window).load(function() { $('#slider').nivoSlider(); }); </script> </head> Code (markup):
You're using different libraries., which often lead to such problems. I suggest trying to use only one library, and then find plugins that does what you want.
If you view the source of any large website you'll see that they have lots of javascript files listed in their head section - you've got 6 in your example. My concern is that you have 3 scripts all trying to do the same thing prototype scriptaculous jquery Pick a library and stick to it. I'm guessing you've been trawling the web for things that do what you want and then nobbling them all together. Time to get serious and tidy up your site, do some decent programming and avoid the conflicts between the js libraries.
Welcome to Jquery crap central. A big issues with jquery is that there are zero recognized standards, so conflicts and compatibility issues are common. If you don't have the skills to go into the jquery script and modify the code causing the problem, then you really should not be using third party jquery files that you cannot evaluate prior to using them. 10-15% of jquery plugins contain malware If you are not capable of fixing the jquery yourself, you might want to see if you can get help from the support page of the place where you got the plugins though very few purveyors of jquey trash collections actually provide any support.
Or none whatsoever since they're bloated BS that typically let people add crap to websites that have no damned business on websites in the first place. See 90%+ of "slideshow" style effects that are little more than a waste of bandwidth, waste of screen space, piss off users trying to find actual content, and more often than not are used to fill up screen space to hide a lack of actual content of value. Christmas on a cracker you're loading six malfing scripts for what? A crappy lightbox effect that shouldn't even take more than 5k of scripting, and some stupid slideshow? Plow that. Much less good scripts should be able to be loaded AFTER the content in BODY so they can start loading faster/sooner. Admittedly I say the same thing about multiple stylesheets and <style> tags without media targets... That whole page though being a laundry list of how not to build a website with it's endless pointless DIV for nothing, endless pointless classes and ID for NOTHING, tables for layout, breaks doing padding's job, paragraphs wrapping non-paragraph content, zero keywords relevance, tags like CENTER that have zero business on any website written after 1997, clearing breaks like it's still 2001, gibberish use of vertical breaks, copyright copyright, presentational images in the markup, gibberish use of headings, non real-world deployable doctype, lack of alt text on EVERY image, closing tags for anchors that aren't even open, etc, etc... Normally you'd think at 3.83k it would be impossible for it to be a bloated mess... but, well.... about a third of that belongs on the cutting room floor.