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

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
JackMcHale
Beginner
Beginner
Posts: 3
Joined: Thu Mar 08, 2007 7:55 pm

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

Post by JackMcHale »

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: Select all

<!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]
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

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?
JackMcHale
Beginner
Beginner
Posts: 3
Joined: Thu Mar 08, 2007 7:55 pm

Uh, no I can't post it.

Post by JackMcHale »

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.
JackMcHale
Beginner
Beginner
Posts: 3
Joined: Thu Mar 08, 2007 7:55 pm

A better example

Post by JackMcHale »

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]
Post Reply