• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1032
  • Last Modified:

Object Expected Error in Javascript file

In IE 6 & 7, I'm getting an error that says, "Object expected line 110 char 4 (name of file page is on).

In IE 8, I'm getting an error that says, "Object expected line 109 char 4 all.js.

You can see the site here: http://www.dontmesswithtexas.org/.

I've uploaded the code for all.js.

I have also updated the jquery.js file to the latest version.

Any help would be greatly appreciated.

Thanks,
Lisa

$(document).ready(function(){

	//GATHER VARS
	var pageId = $('body').attr('id');
	var pageClass = $('body').attr('class');
	var pageClassArray = pageClass.split(" ");
	var site = pageClassArray[0];
	var section = pageClassArray[1];
	var pageTemplate = pageClassArray[2];
	
	
	//LAYOUT
	$('div#sidebar').prepend('<div class="top" id="sidebar_top"></div>');
	$('div#sidebar').append('<span class="bottom"></span>');
	$('div#footer').wrapInner('<div class="footer"></div>');
	var footer = $('div#footer').contents();
	$('div#footer').remove();
	var masthead = $('div#masthead');
	masthead.removeClass('grid_16');
	$('div#masthead').remove();
	//$('div:not(.has_subnav) div#masthead').css();
	$('div#content div.middle').append(footer);
	//$('div#content').wrapInner('<div class="middle"></div>');
	$('div#content').prepend('<span class="top"></span>');
	$('div#content').append('<span class="bottom"></span>');	
	
	var h2Height = $('div.middle h2').height();
	$('div#subnav').css('marginTop',h2Height + 48);	


		
	//TEMPLATE CHANGES
	$('body.template1 div#content').addClass('grid_12');
	$('body.template1 div#content + div#subnav').prev().removeClass('grid_12').addClass('grid_8').addClass('has_subnav');
	$('div.has_subnav div.middle').contents().css({"width":"440px"});
	$('div.has_subnav div#masthead').css("width","659px");
	$('div#subnav').append("<span class='bottom'></span>");
	$('div.has_subnav div.footer').css("width","659px");
	$('#flash_video_holder').css("width","auto");
	$('div#content div.middle').prepend(masthead);

	
	
	//ROTATORS
	$('ul.main_rotator').cycle({
		fx: 'fade',
		speed: 500,
		timeout: 5000,
		pager: '#rotator_nav',
		next: '#rotator_nav_next',
		prev: '#rotator_nav_prev'	
	});
	
	var rotatorOffset = 23;
	
	 $("#rotator_nav a").each(function(i){
	 	//alert(i);
		$(this).css("left",(rotatorOffset * (i)) + 26 + "px");
		$("#rotator_nav_next").css("left",(rotatorOffset * (i)) + 49 + "px");
 	});

	
	//WHERE ARE YOU
	$('div#super_nav ul li.' + site ).addClass('active');
	$('div#sidebar ul li.' + section ).addClass('active');
	$('div#subnav ul li.' + pageId ).addClass('active');
	
	//ALERTS
	$('.alertGood').fadeIn();
	$('.alertBad').fadeIn();
	
	//NESTED NAVS
	$('ul li.sub-sub-nav ul').hide();
	$('ul li.' + pageId + ' ul').show();
	$('ul li.sub-sub-nav ul li.active').parent().show();
	$('li.sub-sub-nav ul li.active').parent().parent().prev().addClass('active'); 

	//TOGGLES
	$('.toggle').click(function() {
		$('div[rel=' + $(this).attr('rel') + ']').toggle();
		return false;
	});
	
	$('body#contact-us input#email, body#about-logo-and-usage input#email').blur(function() {
		$('input#send_from').val($(this).val());
	});
	
	//AJAX EMAIL FORM
	$('#ajax_email_form').submit(function() {
			$('#form_output').html("Submitting...");
			var formValues = $(this).formSerialize();
			$.get("ajax.send-email.php?" + formValues ,function(data) {
				var response = data;
				if (response == "Form submitted.") {
					$('#ajax_email_form ul li:not(#form_output)').slideUp();
					$('#form_output').html(data).addClass('alertGood');
				}//close if
				else {
					$('#form_output').html(data).addClass('alertBad');
					Recaptcha.reload()
				}
				$('#form_output').parent().fadeIn().css("height","400px");	
			});
	        return false; 
	}); 

  		if($.browser.msie){
			init();
   		}//close if	


	if ($('div#content div.middle').height() < 630) {
		$('div#content div.middle').height(630);
	}//close if
	
	

	
	
 });//close on ready
 
 
 //FUNCTION

Open in new window

0
lisacowan
Asked:
lisacowan
  • 2
  • 2
1 Solution
 
MorcalavinCommented:
Where is the init() function located?  Is it in one of the minified code files, or am I just missing it somewhere?
0
 
me655321Commented:
There's an error with your call to init(). What is the init function you're calling?
0
 
lisacowanAuthor Commented:
I'm not sure. Could it be in a separate file? I didn't write this stuff. I'm just debugging it.

Lisa
0
 
MorcalavinCommented:
Unless it's in the minified code files, then that's what is causing the error.  There is an easy way to check.  Comment it out
//init()

and see what happens!
0
 
lisacowanAuthor Commented:
Commenting it out did the trick. I wonder why it was there in the first place.

Thanks for the help.

Lisa
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now