SiteExperts.com Logo Home | Community | Developer's Paradise
User Groups | Site Tools | Site Information | Search
 Main Menu
 Forums
SiteExperts.com Forums
All Discussions

SiteExperts Feedback
The Lounge
Dynamic HTML
Site Design/ Critiques
HTML and CSS
XML Technologies
The Wireless Internet
Internet Explorer
Microsoft .NET
The Server
Technical Support

Sponsored Links

User Groups : Forums : SiteExperts : Dynamic HTML :

Previous DiscussionNext Discussion
 getElementById problem IE/Firefox

I am using some Javascript code which generates a menu structure, which in Firefox works but in Internet Explorer 6.0 does not. The problem starts with the getElementById, where on hitting the specific command IE will stop and comment: getElementById(...) is empty or no object. The complete code is something along the lines of:

document.getElementById("tb").getElementById("a")

IE does not stomach this command, but in Firefox it works without any problem. Does anybody have any suggestions?

Much obliged,


Victor

Started By freshjive on Dec 20, 2005 at 5:18:59 AM

11 Response(s) | Reply

Earlier Replies | Replies 5 to 11 of 11 | Later Replies
Goto Page: 2 1
freshjive on Dec 21, 2005 at 2:25:23 AM (# 5)

well, you asked for it. this is the whole code:

// JavaScript Document
var ie5 = (document.getElementById && document.all);
var ns6 = (document.getElementById && !document.all);
var myEffect = "blendTrans(Duration=1.2)";;

function showFilter(obj, visibility) {
if(ie5){
menu[obj].style.filter = myEffect; // set your effect from one of the top 25 differents effects
menu[obj].filters[0].Apply();
menu[obj].style.visibility = visibility;
menu[obj].filters[0].Play();
}
else if(ns6){
menu[obj].style.visibility = visibility;
}
}

function showHide(obj, visibility) {
if(ie5 || ns6){
menu[obj].style.visibility = visibility;
}
}

function menuBarInit() {
if(ie5 || ns6){
menu = document.getElementsByTagName("div");
}
}

function MakeActive(num) {
if(ie5 || ns6) {
for(i=0;i lnk[i].style.color = "#006699";
lnk[num].style.color = "red";
}
}
}

function makeActiveInit() {
if(ie5 || ns6){
lnk = document.getElementById("tb").getElementsByTagName("a");
for(i=0;i lnk[i].onfocus=new Function("if(this.blur)this.blur()");
lnk[16].style.color = "red";
}
}
if(ie5)
document.getElementById("tb").style.visibility = "visible";
}


MHenke on Dec 21, 2005 at 2:53:55 AM (# 6)

Hum, I have asked for the corresponding HTML code...


bod1467 on Dec 21, 2005 at 4:41:36 AM (# 7)

Indeed. And I was justified in asking for the proper JS code, since it is document.getElementById("tb").getElementsByTagName("a"); that is being used and not what was originally posted. 8-)


Winterwolf on Dec 21, 2005 at 9:15:28 AM (# 8)

First issue: I am stunned by the lack of functionality with so much code ...toggle the Active links (or not since the whole effect is superfluous) using css. next issue: try using childNode.


hedger on Dec 21, 2005 at 5:25:57 PM (# 9)

Which docType do you use?
http://blog.360.yahoo.com/blog-ktYYK_s5fqJ2Hu1ryv2QSL0-?p=106

Do get detect browsers correctly?
http://blog.360.yahoo.com/blog-ktYYK_s5fqJ2Hu1ryv2QSL0-?l=11&u=16&mx=18&lmt=5&p=5


manoj_achan on Dec 29, 2005 at 12:05:56 PM (# 10)

Re-install JRE2.0 and set IE6.0 ->Tools->Advanced settings ->default

RGDS


manoj_achan on Dec 29, 2005 at 12:07:48 PM (# 11)

Goto IE6.0->Tools->Security->Customize->Enable all Java settings.

RGDS


Earlier Replies | Replies 5 to 11 of 11 | Later Replies
Goto Page: 2 1

To respond to a discussion, you must first logon.

If you are not registered, please register yourself to become a member of the SiteExperts.community.

User Name
Password
Copyright 1997-2004 InsideDHTML.com, LLC. All rights reserved.