Solved

Javascript DHTML Menu with Error: Object Expected??

Posted on 2004-04-04
10
897 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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Angular tyeahead feature not working with Control "as" ControlXXX 4 51
Glitching Slide Show 19 40
Put javascript to get dropdown value 3 33
javascript delete path 7 45
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
This article discusses how to implement server side field validation and display customized error messages to the client.
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…

751 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