Solved

Javascript DHTML Menu with Error: Object Expected??

Posted on 2004-04-04
10
898 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 84 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 15

Assisted Solution

by:VincentPuglia
VincentPuglia earned 83 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 83 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

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. …
I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
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
Course of the Month11 days, 15 hours left to enroll

623 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