Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Javascript DHTML Menu with Error: Object Expected??

Posted on 2004-04-04
10
Medium Priority
?
900 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
10 Comments
 

Author Comment

by:mknight9
ID: 10752263
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
ID: 10752268
Invalid log-in. Please try again
0
 
LVL 25

Accepted Solution

by:
devic earned 336 total points
ID: 10752309
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 15

Assisted Solution

by:VincentPuglia
VincentPuglia earned 332 total points
ID: 10752350
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
 
LVL 12

Expert Comment

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

Assisted Solution

by:lil_puffball
lil_puffball earned 332 total points
ID: 10753815
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
ID: 10789966
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
ID: 11115641
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
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…

730 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