Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Nov 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Object expected - IE Error

    The website is CnJ-Tree.atwebpages.com

    The site works in everything, except, IE. Of course, never fails right.

    Anyway, the error is with the navigation. I keep getting object expected errors, on pretty much all of my onMouseOver, onMouseOut, and onClick events.

    Here is the html.

    Code:
    <tr>
    		<td background="images/CnJ-Layout_04.png" width="720" height="28" valign="middle" align="center">
    		<div id="container" class="navigation">
    		
    			<a href="#" onClick="openPage('home.php');"><div id="home" class="home" align="center" onMouseOver="navOpen('home');" onMouseOut="navClose('home');">Home</div></a>
    			
    			<a href="#" onClick="openPage('contact.php')"><div id="contact" class="contact" align="center" onMouseOver="navOpen('contact')" onMouseOut="navClose('contact')">Contact Us</div></a>
    			
    			<div id="service" class="service" align="center" onMouseOver="mopen('serviceDropDown'); navOpen('service');" 
            onMouseOut="mclosetime(); navClose('service');" style="cursor:pointer">Services</div>
    			
    			<div id="serviceDropDown" class="serviceDropDown" align="center" onMouseOver="mcancelclosetime(); navOpen('service');" 
                onMouseOut="mclosetime(); navClose('service');" style="visibility: hidden">	
    				<div id="tree" style="cursor:pointer" onClick="openPage('tree-removal.php')" onMouseOver="navOpen('tree')" onMouseOut="navClose('tree')">Tree Removal</div>
    				<div id="trimming" style="cursor:pointer" onClick="openPage('tree-removal.php')" onMouseOver="navOpen('trimming')" onMouseOut="navClose('trimming')">Tree Trimming</div>
    				<div id="hauling" style="cursor:pointer" onClick="openPage('tree-removal.php')" onMouseOver="navOpen('hauling')" onMouseOut="navClose('hauling')">Any Hauling</div>
    			</div>
    			
    			<div id="about" class="about" align="center" onMouseOver="navOpen('about')" onMouseOut="navClose('about')">About Us</div>
    			
    			<div id="gallery" class="gallery" align="center" onMouseOver="navOpen('gallery')" onMouseOut="navClose('gallery')">Gallery</div>
    			</div>
    			</td>
    	</tr>
    And here is the JS for the related areas.

    Code:
    <script type="text/javascript">
    var xmlhttp
    
          window.onload=function(){ 
             var dotspan = document.getElementById('dots'); 
             window.setInterval(function(){ 
                if(dotspan.innerHTML == '...'){ 
                   dotspan.innerHTML = '.'; 
                } 
                else{ 
                   dotspan.innerHTML += '.'; 
                } 
             }, 200); 
    		 
    		 // Initiate AJAX usage
    		try { xmlhttp = new XMLHttpRequest(); } // Firefox, Opera 8.0+, Safari
    		catch(e){
    			try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } // Internet Explorer
    			catch(e){
    				try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } // Internet Explorer
    				catch(e){
    					alert("Your browser does not support AJAX!");
    					return false;
    				}
    			}
    		}	 
          }
    
    function navOpen(page)
    {
    	document.getElementById(page).style.backgroundImage = "url(images/navi-rollover.png)";
    	document.getElementById(page).style.color = "#787864";
    		
    }
    
    function navClose(page)
    {
    	document.getElementById(page).style.backgroundImage = "";
    	document.getElementById(page).style.color = "#9b9b80";
    }
    
    var timeout	= 500;
    var closetimer	= 0;
    var ddmenuitem	= 0;
    
    // open hidden layer
    function mopen(id)
    {	
    	// cancel close timer
    	mcancelclosetime();
    
    	// close old layer
    	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
    
    	// get new layer and show it
    	ddmenuitem = document.getElementById(id);
    	ddmenuitem.style.visibility = 'visible';
    
    }
    // close showed layer
    function mclose()
    {
    	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
    }
    
    // go close timer
    function mclosetime()
    {
    	closetimer = window.setTimeout(mclose, timeout);
    }
    
    // cancel close timer
    function mcancelclosetime()
    {
    	if(closetimer)
    	{
    		window.clearTimeout(closetimer);
    		closetimer = null;
    	}
    }
    
    // close layer when click-out
    document.onClick = mclose; 
    
    
      window.onload=function(){ 
    		 // Initiate AJAX usage
    		try { xmlhttp = new XMLHttpRequest(); } // Firefox, Opera 8.0+, Safari
    		catch(e){
    			try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } // Internet Explorer
    			catch(e){
    				try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } // Internet Explorer
    				catch(e){
    					alert("Your browser does not support AJAX!");
    					return false;
    				}
    			}
    		}	 
          }
    
    function openPage(id)
    {
    xmlhttp=GetXmlHttpObject();
    if (xmlhttp==null)
      {
      alert ("Your browser does not support XMLHTTP!");
      return;
      }
    var url=id;
    xmlhttp.onreadystatechange=function(){
    if(xmlhttp.readyState !=4){
    	document.getElementById("main").innerHTML=("<center><img src='http://upload.wikimedia.org/wikipedia/commons/4/42/Loading.gif'></center>");
    	}
    else{
    
      document.getElementById("main").innerHTML=xmlhttp.responseText;
      }
      }
      ;
    xmlhttp.open("GET",url,true);
    xmlhttp.send(null);
    
    
    function GetXmlHttpObject()
    {
    if (window.XMLHttpRequest)
      {
      // code for IE7+, Firefox, Chrome, Opera, Safari
      return new XMLHttpRequest();
      }
    if (window.ActiveXObject)
      {
      // code for IE6, IE5
      return new ActiveXObject("Microsoft.XMLHTTP");
      }
    return null;
    }
    
    }
    </script>
    Last edited by Redman-Racer; 11-18-2010 at 05:53 AM.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,171
    Thanks
    75
    Thanked 4,338 Times in 4,304 Posts
    This code is bogus:
    Code:
    if (passcheck == "No") {
    	break;
    }
    I think you mean to have return there, not break.

    Once you get that error, all bets are off.

    Anyway, MSIE is complaining about mopen( ). Fix that first bug and see if the other goes away.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    New to the CF scene
    Join Date
    Nov 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    OO :O , that was simple.

    Thanks, now I got some layout problems in the contact page. Thats another forum though,

    THanks again.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •