PDA

View Full Version : What Does This Error Mean?



jihanemo
11-13-2008, 12:18 AM
At the bottom of my IE7 browser the little "Error" icon is showing up for this page - http://americanchic.net/testpage.html . Here is the error:

(not sure whether or not this is technically code so I just put it in a block anyway)

Line: 166
Char: 1
Error:'ie4' is undefined
Code: 0
URL: http://americanchic.net/testpage.html

And another error:

Line: 216
Char: 1
Error:'ie4' is undefined
Code: 0
URL: http://americanchic.net/testpage.html

What does this mean and how do I fix it?

rangana
11-13-2008, 12:58 AM
I'm unable to see the error's cause since refreshing it removes the error. Usually, this is cause by the unnecessary comment strings:


<!-- ******* BEGIN IMAGE GALLERY SCRIPT ******* -->

<script type="text/javascript" src="jquery.js"></script>

<script type="text/javascript">
$(document).ready(function(){

$("h2").append('<em></em>')

$(".thumbs a").click(function(){

var largePath = $(this).attr("href");
var largeAlt = $(this).attr("title");

$("#largeImg").attr({ src: largePath, alt: largeAlt });

$("h2 em").html(" (" + largeAlt + ")"); return false;
});

});
</script>

<!-- ******* CLOSE IMAGE GALLERY SCRIPT ******* -->



<!-- ******* BEGIN POP-IT MENU SCRIPT ******* -->


Find time to rectify highlighted with just:


<!--COMMENT HERE-->


...if problem still exists, get back.

jscheuer1
11-13-2008, 04:27 AM
There is nothing wrong with those comments. The suggested replacements however should contain spaces:


<!-- COMMENT HERE -->

I am currently getting no error from the page in IE 7. When it was giving the error, it's pretty straight forward what it was about. A script on the page was trying to access a variable named ie4 that either wasn't defined, or whose definition had been changed to undefined or to something that was undefined after it was defined and before it was accessed.

I see in the source code:


var ie4=document.all

as long as that occurs before ie4 is accessed and nothing contradicts it, the error should not occur.

rangana
11-13-2008, 04:29 AM
He's been convinced: http://codingforums.com/showthread.php?t=152148

jscheuer1
11-13-2008, 06:51 AM
He's been convinced: http://codingforums.com/showthread.php?t=152148

That answer wasn't very good, unless you are looking for humor, and even then it was a bit lame, because it gave some false information:


Your version of IE7 is pretending it never heard of IE4- like what Microsoft will do about Vista in a year or so.

Nothing to worry about, but I would switch to firefox, which, when it doesn't understand something, doesn't brag about it.

This assumes error reporting on in IE 7 and off in FF. These are settings any user may adjust to his or her own preference.

And the IE 7 browser wasn't pretending it didn't know about IE 4, it hasn't, no browser has. It was in fact reacting to an error in the code (which presumably has since been corrected), code that just happens to be using 'ie4' (a bad choice in variable names to begin with) incorrectly as a named variable.