Solved

Javascript DHTML Menu with Error: Object Expected??

Posted on 2004-04-04
10
891 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
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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
In Angular, how can I programatically fire a function 8 56
JS Plugin Chaining 2 32
JavaScript export function not working in IE 15 38
Check if Object property exists? 3 19
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…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…

863 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

23 Experts available now in Live!

Get 1:1 Help Now