Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:39

setting document.domain causes the sub menus to break in IE


Poster: JackMcHale
Dated: Thursday March 8 2007 - 19:14:19 GMT

I have an app that needs to be framed my one of our maintenance apps. In order to get the maintenance app to talk to the main application pane, I need to add the command - document.domain="<my internal domain>". The domain that I'm using is valid, but it causes the menu to break in IE (both 6 and 7).

After digging through the code, I've isolated it to having the menus and this command on the same page.

A few notes -
*Our public facing domain (http://www.circuitcity.com) is still using the old menus. I'm getting this error with 5.770 (which I'm currently testing). the old menus do not cause this issue. Until I get this resolved, I can't upgrade.

*I'm very confident that our menu data file is fine. Without the call to document.domain, everything works just dandy. In fact, even the top level menus load - just no submenus.

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
                         <title>circuitcity.com Consumer Electronics</title> 
   <link type="text/css" rel="stylesheet" href="/css/common.css">
<link type="text/css" rel="stylesheet" href="/IMAGE/Home/categorystyle.css">
 
</head>
<body topmargin="2" leftmargin="0" marginheight="0" marginwidth="0">
<script language="JavaScript">
<!--
var epPopupUrl = '/ccd/exitPoll.do';
var hasCookies = navigator.cookieEnabled;
-->
</script>
<SCRIPT language=JavaScript src="/js/milonic_src.js" type=text/javascript></SCRIPT>
<script language=JavaScript>if(ns4)_d.write("<scr"+"ipt language=JavaScript src=/js/mmenuns4.js></scr"+"ipt>");else _d.write("<scr"+"ipt language=JavaScript src=/js/mmenudom.js></scr"+"ipt>");</script>
<script language=JavaScript>if(hasCookies)document.write("<SCR"+"IPT language=JavaScript src='/ccd/TopMenu.do' type=text/javascript></SCR"+"IPT>");</script>  <script language="JavaScript" src="/js/nav.js"></script>

<table id="wsanoscriptnav" width="715" border="0" cellspacing="0" cellpadding="0">
<tr><td align="left">blah/td>    </tr>
</table>

<script>
if(hasCookies)
{
var noScriptNav = document.getElementById("wsanoscriptnav");
noScriptNav.style.display="none";
drawMenus();
}
</script>

<form name="eti_navigation"><input type="hidden" name="nav" value="0"><input type="hidden" name="srchTerms" value=""><input type="hidden" name="srchKey" value=""></form>
<script language="JavaScript">
<!--
document.domain='ccs.com';
// -->
</script>
</html>
[/code]


Poster: Andy
Dated: Thursday March 8 2007 - 23:22:50 GMT

From looking at your code there are several files that we will need in order to test this.

Also, would it be possible for you to publish something that we can see?

Uh, no I can't post it.


Poster: JackMcHale
Dated: Friday March 9 2007 - 17:47:04 GMT

Unfortunately, I can't throw up pages on an external site from work. The milonic files are 5.770 of the menus. You can ignore that nav.js file. The css files are off of http://www.circuitcity.com.

A better example


Poster: JackMcHale
Dated: Monday March 12 2007 - 15:56:43 GMT

I tried debugging further and the submenus don't work in IE 6 ands 7 with the default code. Below is a test page I've been using. The milonic files and the data file are straight from the 7.770 build of the menus. All I have is a call to document.domain (and yes, it's a valid call - our dev box here is .ccs.com). You can change the domain to whatever you like to test it.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>circuitcity.com Consumer Electronics</title>

</head>
<body topmargin="2" leftmargin="0" marginheight="0" marginwidth="0">

<SCRIPT language=JavaScript src="/js/milonic_src.js" type=text/javascript></SCRIPT>
<script language=JavaScript>if(ns4)_d.write("<scr"+"ipt language=JavaScript src=/js/mmenuns4.js></scr"+"ipt>");else _d.write("<scr"+"ipt language=JavaScript src=/js/mmenudom.js></scr"+"ipt>");</script>
<script language="JavaScript" src="/js/menu_data.js"></script>

<form name="eti_navigation"><input type="hidden" name="nav" value="0"><input type="hidden" name="srchTerms" value=""><input type="hidden" name="srchKey" value=""></form>
<script language="JavaScript">
<!--
document.domain='ccs.com';
// -->
</script>
</html>[/code]