Solved

Javascript DHTML Menu with Error: Object Expected??

Posted on 2004-04-04
10
889 Views
Last Modified: 2007-12-19
Hi
Here is the link to the page login is Admin Admin (temporarily) http://www.lgpartnersinc.com/Services.asp



When you hover over my menu you get an error on the page Code: 0 Error: Object Expected.
It may seem like a lame question to most here but what is the object thats expected. I have looked at my code to no success.

Here is the code where the error is
      <tr>
        <td width="10" height="19" align="left" bgcolor="#990000">&nbsp;</td>
        <td width="63" valign="bottom" bgcolor="#990000"> <img src="../Images/line-space.gif" border="0" width="12" height="12"><a class="menu" href="Services.asp" onmouseout="btnTimer(), hilite(document.Aboutus,0)" onmouseover="showLayer('Aboutus'), hilite(document.AboutUs,1)">About Us</a></td>
        <td width="43" valign="bottom" bgcolor="#990000"> <img src="../Images/line-space.gif" width="12" height="12" border="0"><a class="menu" href="IPO-Market-Report.asp" onmouseout="btnTimer(), hilite(document.products,1)" onmouseover="showLayer('Products'), hilite(document.products,1)">News</a></td>
        <td width="125" valign="bottom" bgcolor="#990000"> <img src="../Images/line-space.gif" border="0" width="12" height="12"><a class="menu" href="Previous-Reccommendations.asp" onmouseout="btnTimer(), hilite(document.Recommends,2)" onmouseover="showLayer('Recommends'), hilite(document.Recommends,2)">Research & Strategy</a></td>
        <td width="112" valign="bottom" bgcolor="#990000"> <img src="../Images/line-space.gif" border="0" width="12" height="12"><a class="menu" href="Becoming-a-Client.asp" onmouseout="btnTimer(), hilite(document.support,3)" onmouseover="showLayer('Support'), hilite(document.support,3)">Becoming a Client</a></td>
        <td width="119" valign="bottom" bgcolor="#990000"> <img src="../Images/line-space.gif" border="0" width="12" height="12"><a class="menu" href="Markets-Research.asp" onmouseout="btnTimer(), hilite(document.Client,4)" onmouseover="showLayer('Client'), hilite(document.Client,4)">Market & Research</a></td>
        <td width="122" valign="bottom" bgcolor="#990000"> <img src="../Images/line-space.gif" border="0" width="12" height="12"><a class="menu" href="Disclaimer.asp" onmouseout="btnTimer(), hilite(document.Disclaim,5)" onmouseover="showLayer('Disclaim'), hilite(document.Disclaim,5)">Disclaimer </a></td>
      </tr>


 Though is does not appear detrimental to my pages I don't think an error on the page looks very professional.


Hope someone can help.
Ian Hill
UK
0
Comment
Question by:mknight9
  • 3
  • 2
  • 2
  • +1
10 Comments
 

Author Comment

by:mknight9
Comment Utility
To make things easier maybe here is  one line of the code for one of the dropdown menu items

  <td width="63" valign="bottom" bgcolor="#990000"> <img src="../Images/line-space.gif" border="0" width="12" height="12"><a class="menu" href="Services.asp" onmouseout="btnTimer(), hilite(document.Aboutus,0)" onmouseover="showLayer('Aboutus'), hilite(document.AboutUs,1)">About Us</a></td>


Ian
0
 
LVL 25

Expert Comment

by:devic
Comment Utility
Invalid log-in. Please try again
0
 
LVL 25

Accepted Solution

by:
devic earned 84 total points
Comment Utility
hi mknight9,

so, i don't see your page, but here an example:

<script>
var ll;
function btnTimer()
{
      ll.style.display="none"
}

function hilite(obj,st)
{
      if(st==1)
      {
            obj.style.backgroundColor="red"
      }
      else
      {
            obj.style.backgroundColor="ffffff"
      }
}

function showLayer(divID)
{
      ll=document.getElementById(divID);
      ll.style.display=""
}


</script>
<td width="63" valign="bottom" bgcolor="#990000"> <img src="../Images/line-space.gif" border="0" width="12" height="12">
<a class="menu" href="Services.asp" onmouseout="btnTimer(), hilite(this,0)"
onmouseover="showLayer('Aboutus'), hilite(this,1)">About Us</a></td>

<div id=Aboutus style=display:none>
<img src=http://www.lgpartnersinc.com/images/Index-Images/border_19.jpg>
</div>

0
 
LVL 15

Assisted Solution

by:VincentPuglia
VincentPuglia earned 83 total points
Comment Utility
Hi,

="btnTimer(), hilite(document.Aboutus,0)"

for starters: that comma -- btnTimer(), -- should be a semi-colon

'object expected' errors usually imply that a function is trying to access an object that hasn't been created -- eg if your menu is trying to set a div with content before the browser has had time to read the line that contains the div.

Vinny
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 12

Expert Comment

by:lil_puffball
Comment Utility
Also, you don't have a function called hilite() on the page.
0
 
LVL 12

Assisted Solution

by:lil_puffball
lil_puffball earned 83 total points
Comment Utility
It works if you change the block of code to this:

        <td width="63" valign="bottom" bgcolor="#990000"> <img src="Images/line-space.gif" border="0" width="12" height="12"><a class="menu" href="Services.asp" onmouseout="btnTimer();" onmouseover="showLayer('Aboutus');">About Us</a></td>
        <td width="43" valign="bottom" bgcolor="#990000"> <img src="Images/line-space.gif" width="12" height="12" border="0"><a class="menu" href="IPO-Market-Report.asp" onmouseout="btnTimer()" onmouseover="showLayer('Products');">News</a></td>
        <td width="125" valign="bottom" bgcolor="#990000"> <img src="Images/line-space.gif" border="0" width="12" height="12"><a class="menu" href="Previous-Reccommendations.asp" onmouseout="btnTimer()" onmouseover="showLayer('Recommends')">Research & Strategy</a></td>
        <td width="112" valign="bottom" bgcolor="#990000"> <img src="Images/line-space.gif" border="0" width="12" height="12"><a class="menu" href="Becoming-Client.asp" onmouseout="btnTimer()" onmouseover="showLayer('Support')">Becoming a Client</a></td>
        <td width="119" valign="bottom" bgcolor="#990000"> <img src="Images/line-space.gif" border="0" width="12" height="12"><a class="menu" href="Markets-Research.asp" onmouseout="btnTimer()" onmouseover="showLayer('Client')">Market & Research</a></td>
        <td width="77" valign="bottom" bgcolor="#990000"> <img src="Images/line-space.gif" border="0" width="12" height="12"><a class="menu" href="Disclaimer.asp" onmouseout="btnTimer()" onmouseover="showLayer('Disclaim')">Disclaimer </a></td>
0
 

Author Comment

by:mknight9
Comment Utility
Hi, sorry beeen a liitle tied up with work etc. I will test the soluton soon and get back.

Thanks
Guys
0
 

Author Comment

by:mknight9
Comment Utility
Hi,
There reason why this forum question appears abandoned, is becuase when I came back to view it, the question was unavailable on numerous atempts.

I am happy with the forced acception. does that mean he got they points, I hope so,

Cheers Ian.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now