Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 325
  • Last Modified:

Why is IE6 doing this with my script?

I'm testing the web site I'm working on with various browser versions.  IE 5 for Mac, NS 4 & 6 for Mac,
NS 4 for Windows and finally IE 6 for Windows.  This is where I run into a problem, IE 6 for Windows.
 In my javascript menu, using IE 6, an "E" with one of these (^) is generated at the beginning of both
my menu items and submenu items.  I don't understand.  I can only attribute this to how IE 6 is handling
the script.  Hoping someone can give me an answer and a cure.  Thanks.
0
wec012299
Asked:
wec012299
  • 8
  • 7
1 Solution
 
b1xml2Commented:
set the following in your scripts

document.charSet = "iso-8859-1";
0
 
wec012299Author Commented:
Is it that easy?  I'll give it a try.
0
 
wec012299Author Commented:
Is there a specific spot where this needs to be inserted?  I added it right after the script tag and it won't do the trick.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
b1xml2Commented:
show us your script please
0
 
b1xml2Commented:
remember that you can override the encoding settings meant for a page via View--->Encoding and you will see pretty weird characters.
0
 
wec012299Author Commented:
the encoding option did not work.

Here's the script:

<script language="JavaScript" src="navcond.js"></script>

<script language="JavaScript">

var myNavBar1 = new NavBar(0);

var dhtmlMenu;

//define menu items (first parameter of NavBarMenu specifies main category width, second specifies sub
category width in pixels)

//add more menus simply by adding more "blocks" of same code below



dhtmlMenu = new NavBarMenu(200, 100);

dhtmlMenu.addItem(new NavBarMenuItem("Home", "http://www.abc.com"));

myNavBar1.addMenu(dhtmlMenu);



dhtmlMenu = new NavBarMenu(200, 100);

dhtmlMenu.addItem(new NavBarMenuItem("News", ""));

dhtmlMenu.addItem(new NavBarMenuItem("Tips", "http://www.abc.com"));

dhtmlMenu.addItem(new NavBarMenuItem("Great New Sites", "http://www.abc.com"));

myNavBar1.addMenu(dhtmlMenu);



dhtmlMenu = new NavBarMenu(200, 100);

dhtmlMenu.addItem(new NavBarMenuItem("Contributors", ""));

dhtmlMenu.addItem(new NavBarMenuItem("Thermador", "http://www.abc.com"));

dhtmlMenu.addItem(new NavBarMenuItem("Vermont Soapstone", "http://www.abc.com"));

dhtmlMenu.addItem(new NavBarMenuItem("Warm Rails", "http://www.abc.com"));

dhtmlMenu.addItem(new NavBarMenuItem("Select Comfort", "http://www.abc.com"));

myNavBar1.addMenu(dhtmlMenu);



dhtmlMenu = new NavBarMenu(200, 100);

dhtmlMenu.addItem(new NavBarMenuItem("Services", ""));

dhtmlMenu.addItem(new NavBarMenuItem("Web Hosting", ""));

myNavBar1.addMenu(dhtmlMenu);



dhtmlMenu = new NavBarMenu(200, 100);

dhtmlMenu.addItem(new NavBarMenuItem("Contact Us", ""));

dhtmlMenu.addItem(new NavBarMenuItem("Production", "mailto:production@abc.com?subject=RE: Production
Inquiry..."));

dhtmlMenu.addItem(new NavBarMenuItem("Info", "mailto:info@abc.com?subject=RE: Info Request..."));

dhtmlMenu.addItem(new NavBarMenuItem("New Contributor Submissions", "mailto:submission@abc.com?subject=RE:
Product Submission..."));

myNavBar1.addMenu(dhtmlMenu);



//set menu colors

myNavBar1.setColors("#000000", "#000000", "#C0C0C0", "#ffffff", "#66CC99", "#000000", "#cccccc", "#ffffff",
"#0099CC")



//uncomment below line to center the menu (valid values are "left", "center", and "right"

myNavBar1.setAlign("center")

var fullWidth;

function init() {

 // Get width of window, need to account for scrollbar width in Netscape.



 fullWidth = getWindowWidth()

   - (isMinNS4 && getWindowHeight() < getPageHeight() ? 16 : 0);



 myNavBar1.resize(fullWidth);

 myNavBar1.create();

 myNavBar1.setzIndex(2);

 //UNCOMMENT BELOW LINE TO MOVE MENU DOWN 50 pixels

myNavBar1.moveTo(0, 100);

}

</script>
0
 
b1xml2Commented:
so where is the funny E with the caret appearing?
0
 
wec012299Author Commented:
the encoding option did not work.

Here's the script:

<script language="JavaScript" src="navcond.js"></script>

<script language="JavaScript">

var myNavBar1 = new NavBar(0);

var dhtmlMenu;

//define menu items (first parameter of NavBarMenu specifies main category width, second specifies sub
category width in pixels)

//add more menus simply by adding more "blocks" of same code below



dhtmlMenu = new NavBarMenu(200, 100);

dhtmlMenu.addItem(new NavBarMenuItem("Home", "http://www.abc.com"));

myNavBar1.addMenu(dhtmlMenu);



dhtmlMenu = new NavBarMenu(200, 100);

dhtmlMenu.addItem(new NavBarMenuItem("News", ""));

dhtmlMenu.addItem(new NavBarMenuItem("Tips", "http://www.abc.com"));

dhtmlMenu.addItem(new NavBarMenuItem("Great New Sites", "http://www.abc.com"));

myNavBar1.addMenu(dhtmlMenu);



dhtmlMenu = new NavBarMenu(200, 100);

dhtmlMenu.addItem(new NavBarMenuItem("Contributors", ""));

dhtmlMenu.addItem(new NavBarMenuItem("Thermador", "http://www.abc.com"));

dhtmlMenu.addItem(new NavBarMenuItem("Vermont Soapstone", "http://www.abc.com"));

dhtmlMenu.addItem(new NavBarMenuItem("Warm Rails", "http://www.abc.com"));

dhtmlMenu.addItem(new NavBarMenuItem("Select Comfort", "http://www.abc.com"));

myNavBar1.addMenu(dhtmlMenu);



dhtmlMenu = new NavBarMenu(200, 100);

dhtmlMenu.addItem(new NavBarMenuItem("Services", ""));

dhtmlMenu.addItem(new NavBarMenuItem("Web Hosting", ""));

myNavBar1.addMenu(dhtmlMenu);



dhtmlMenu = new NavBarMenu(200, 100);

dhtmlMenu.addItem(new NavBarMenuItem("Contact Us", ""));

dhtmlMenu.addItem(new NavBarMenuItem("Production", "mailto:production@abc.com?subject=RE: Production
Inquiry..."));

dhtmlMenu.addItem(new NavBarMenuItem("Info", "mailto:info@abc.com?subject=RE: Info Request..."));

dhtmlMenu.addItem(new NavBarMenuItem("New Contributor Submissions", "mailto:submission@abc.com?subject=RE:
Product Submission..."));

myNavBar1.addMenu(dhtmlMenu);



//set menu colors

myNavBar1.setColors("#000000", "#000000", "#C0C0C0", "#ffffff", "#66CC99", "#000000", "#cccccc", "#ffffff",
"#0099CC")



//uncomment below line to center the menu (valid values are "left", "center", and "right"

myNavBar1.setAlign("center")

var fullWidth;

function init() {

 // Get width of window, need to account for scrollbar width in Netscape.



 fullWidth = getWindowWidth()

   - (isMinNS4 && getWindowHeight() < getPageHeight() ? 16 : 0);



 myNavBar1.resize(fullWidth);

 myNavBar1.create();

 myNavBar1.setzIndex(2);

 //UNCOMMENT BELOW LINE TO MOVE MENU DOWN 50 pixels

myNavBar1.moveTo(0, 100);

}

</script>
0
 
wec012299Author Commented:
www.homeestyle.com

see for youself
0
 
b1xml2Commented:
breaking up the code as we speak. Hopefully, we can get to the bottom of things!!!
0
 
b1xml2Commented:
the character is in your javascript file:

if(isMinIE6)str+='<table cellspacing=0 width="100%" height="100%"><tr><td>Ê</td></tr></table>';

remove that.
0
 
b1xml2Commented:
also, while NS 6.2 can't load the menu, it can load your navcond.js and it sees the Ê in your script. That's why you are seeing the Ê. Nothing to do with MSIE.
0
 
wec012299Author Commented:
www.homeestyle.com

see for youself
0
 
b1xml2Commented:
i have seen it wec, it is the character, must be the encoding when you saved the page, but it is there with Opera 6, NS 6, MSIE 6 so it is the script and not the browsers...
0
 
wec012299Author Commented:
Thanks b1xml2.  That was it.  I'm not sure how that happened.  The E only showed up in IE6, so I assumed it had something to do with the browser.  My only explanation is that at some point I think I viewed the script with NS composer which seems to sometimes alter code for some reason.  In addition, I only checked the script within my index page.  I should have dug deeper.  Thanks for all of your help.
0
 
danielle-d-avoutCommented:
you are rendering bad html and Explorer will not tolerate it anymore
IE6 will not allow in some cases bad entities no more naked & but a clean &amp;
no more subject=something
a clean subject='something' and you are safe
for example
the  URL is may be not W3C compliant
have a look on http://validator.w3.org/docs/errors.html#bad-entity
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 8
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now