?
Solved

javascript errors

Posted on 2011-10-17
6
Medium Priority
?
174 Views
Last Modified: 2012-05-12
Why am I getting javascript errors? I have a "script.js" that is in the header of all my hTML files. Not every page uses every script, but that's okay, right? Totally confused. script.js attached.
<!-- dropdown nav -->

$(document).ready(function(){
	$("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled - Adds empty span tag after ul.subnav
	
	$("ul.dropnav li").click(function() { //When trigger is clicked...
		
		//Following events are applied to the subnav itself (moving subnav up and down)
		$(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click
		$(this).parent().hover(function() {
		}, function(){	
			$(this).parent().find("ul.subnav").slideUp('fast'); //When the mouse hovers out of the subnav, move it back up
		});

		//Following events are applied to the trigger (Hover events for the trigger)
		}).hover(function() { 
		
			$(this).addClass("subhover"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			$(this).removeClass("subhover"); //On hover out, remove class "subhover"
	});
	$('ul.subnav').mouseover(function() {
  $("li #top").addClass("selected");
});
	$('ul.subnav').mouseout(function() {
  $("li #top").removeClass("selected");
});

});

<!-- end dropdown nav -->



		

<!-- start slider -->

		$(document).ready(function(){	
		$("#slider").easySlider({
			prevId: 		'previous',
			prevText: 		'previous',
			nextId: 		'next',
			nextText: 		'next',
			speed: 		1200,
			pause:		6000,
			auto: false,
			continuous: true 
		});
		
		if($("#slider"))
		{
			$(document).keydown(function(event){
				if(event.keyCode == 37) $("#previous a").click();
				if(event.keyCode == 39) $("#next a").click();
			});
		}
	});
	
<!-- end slider -->










<!-- Start colorbox -->
$(document).ready(function(){
			//Examples of how to assign the ColorBox event to elements
			$(".group1").colorbox({rel:'group1'});
			$(".group2").colorbox({rel:'group2', transition:"fade"});
			$(".group3").colorbox({rel:'group3', transition:"none", width:"100", height:"100"});
			$(".group4").colorbox({rel:'group4', slideshow:true});
			$(".ajax").colorbox();
			$(".youtube").colorbox({iframe:true, innerWidth:425, innerHeight:344});
			$(".iframe").colorbox({iframe:true, scrolling:false, width:"300px", height:"100%"});
			$(".inline").colorbox({inline:true, width:"600px"});
			$(".callbacks").colorbox({
				onOpen:function(){ alert('onOpen: colorbox is about to open'); },
				onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
				onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
				onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
				onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
			});
			
			//Example of preserving a JavaScript event for inline calls.
			$("#click").click(function(){ 
				$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
				return false;
			});
		});
		
<!-- End colorbox -->

Open in new window

0
Comment
Question by:tekgrl
  • 3
  • 2
6 Comments
 
LVL 13

Expert Comment

by:haloexpertsexchange
ID: 36980777
what javascript  error are you getting?
0
 

Author Comment

by:tekgrl
ID: 36980913
Internal Explorer Script Error

Line 45
Char 3
Object doesn't support this property or method
0
 
LVL 13

Expert Comment

by:haloexpertsexchange
ID: 36980935
do you have a live site that we could look at ?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 13

Expert Comment

by:haloexpertsexchange
ID: 36980979
A couple of things that I noticed.
$(this).parent().find("ul.subnav").slideDown('fast').show();<--you should not need the show, slideDown is already doing that for you.
$(this).parent().hover(function() {
		}, function(){	
			$(this).parent().find("ul.subnav").slideUp('fast'); //When the mouse hovers out of the subnav, move it back up
		});<--since you are not using the mousein function you should probably just do a .mouseout() instead of a hover

Open in new window

0
 

Author Comment

by:tekgrl
ID: 36981002
Sorry, no live site to look at -- privacy issues.
0
 
LVL 3

Accepted Solution

by:
timhigham earned 2000 total points
ID: 36987339
Youre trying to debug with Internet Explorer ? ! ? ! ? Good luck ! ! !  Can I recommend MozilaThunderbird with Firebug addon - INVALUABLE.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question