javascript1
Programmer
Hi,
I am trying to generate a popup menu in a table using Javascript. Here is my code. I got the menu.js file from Gary Smith's website. This works fine in Netscape. But ib IE , I get an error message which says 'style' is not an object. I would appreciate if someone helps me to solve this problem.
<html>
<head>
<title>Popup Menu</title>
</head>
<SCRIPT LANGUAGE="JavaScript1.2" SRC="menu.js"> </SCRIPT>
<body>
<TABLE>
<TR>
<TD VALIGN=TOP NOWRAP>
<script language = "JavaScript1.2">
if (document.all)
{
window.myMenu = new Menu();
myMenu.addMenuItem("my menu item A"
myMenu.addMenuItem("my menu item B"
myMenu.addMenuItem("my menu item C"
myMenu.addMenuItem("my menu item D"
myMenu.writeMenus();
}
else
if (document.layers)
{
window.myMenu = new Menu();
myMenu.addMenuItem("my menu item A"
myMenu.addMenuItem("my menu item B"
myMenu.addMenuItem("my menu item C"
myMenu.addMenuItem("my menu item D"
myMenu.writeMenus();
}
</script>
<LI><A HREF="javascript:window.showMenu(window.myMenu);"
onClick="window.showMenu(window.myMenu);">myMenu</A>
</TD>
</TR>
</TABLE>
</body>
</html>
I am trying to generate a popup menu in a table using Javascript. Here is my code. I got the menu.js file from Gary Smith's website. This works fine in Netscape. But ib IE , I get an error message which says 'style' is not an object. I would appreciate if someone helps me to solve this problem.
<html>
<head>
<title>Popup Menu</title>
</head>
<SCRIPT LANGUAGE="JavaScript1.2" SRC="menu.js"> </SCRIPT>
<body>
<TABLE>
<TR>
<TD VALIGN=TOP NOWRAP>
<script language = "JavaScript1.2">
if (document.all)
{
window.myMenu = new Menu();
myMenu.addMenuItem("my menu item A"
myMenu.addMenuItem("my menu item B"
myMenu.addMenuItem("my menu item C"
myMenu.addMenuItem("my menu item D"
myMenu.writeMenus();
}
else
if (document.layers)
{
window.myMenu = new Menu();
myMenu.addMenuItem("my menu item A"
myMenu.addMenuItem("my menu item B"
myMenu.addMenuItem("my menu item C"
myMenu.addMenuItem("my menu item D"
myMenu.writeMenus();
}
</script>
<LI><A HREF="javascript:window.showMenu(window.myMenu);"
onClick="window.showMenu(window.myMenu);">myMenu</A>
</TD>
</TR>
</TABLE>
</body>
</html>