-
November 13th, 2001, 10:05 AM
#11
Senior Member
Microsoft web programmers need to read a book
Someone at microsoft doesn't know how to write code...
function findDIV(x)
{
var oDiv = document.all.tags("DIV");
var iDiv;
if (oDiv != null)
{
iDiv = oDiv.length;
for (var i=0; i<iDiv; i++)
{
if(oDiv[i].contains(x))
{
return oDiv[i];
}
}
}
}
Can anyone tell me what's wrong with this FUNCTION? (Remember, functions are supposed to return something. What happens if oDiv[i].contains(x) = false?). See, this is why I like compilers because you catch these errors. The error I get is 'function does not always return a value'. So I am assuming it is NOT returning a value in my case.
This specifically caused problems with my browser (Netscape 4.03). It basically was maxing out my cpu and crashing netscape.
The way I see it is that their fancy menu bar calls this function but since my netscape doesn't support divs (i'm assuming, not quite sure though), either oDiv[i].contains(x) returns false OR oDiv = null (obviously otherwise this function would've returned something).
Not sure if this is on topic or not but I hate sloppy code, it's one of my pet peeves.
-
November 13th, 2001, 10:08 AM
#12
Senior Member
oh yeah
Here's a copy of the js file that I found this code in.
-
November 13th, 2001, 07:37 PM
#13
I think this is seperate from the MSN.com problems and the previous news, since it seems to be a scripting issue rather than a header issue, and it wasn't with MSN itself... Actually, I'll try firing up the Proxomitron and seeing if I can isolate it to either a header or a page problem.
[HvC]Terr: L33T Technical Proficiency
-
November 13th, 2001, 08:32 PM
#14
Senior Member
Originally posted by Terr
..it seems to be a scripting issue rather than a header issue...
Remember that I (personally anyways) am using an older browser that doesn't support the newer javascripts, and microsoft is well known for not doing reverse compatibility. So it still might be a header problem, I guess you'll be finding that out soon enough.
Also I thought this was a microsoft.com issue, not msn.com?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|