Hi there, I am doing a site redesign and it shows up without any errors in Firefox, Opera, Safari, Chrome, but in IE for Windows, I get a little "yield sign" in the bottom left hand corner. It says that there's an error on line 16, but there's nothing on that line in the code in the template page. Can someone please check this out and let me know what I'm doing wrong in IE? Could it be the javascript? Thanks!

http://www.asanet.org/footnotes/jan10/index.html

Dani AI

Generated

Good isolation work from and and the markup checklist from helped narrow the problem early. The browser error badge and the vague "line X" message in IE are common symptoms, not a final diagnosis. The most useful next-step is to get the exact failing statement and the runtime stack trace, then fix the null/undefined reference or markup quirk that makes IE trip.

Script debugging in IE gives the best signal. Enable script debugging (uncheck "Disable script debugging" in Internet Options), press F12 to open the developer tools, refresh and let the debugger break on exceptions. That will show the actual .js file and the exact statement that caused "object required" style errors instead of pointing at an arbitrary HTML line. If a debugger is not available, narrow down the spot with temporary try/catch wrappers around suspected initialization code and log guarded values.

Common roots for "object required" in older IE builds:

  • Accessing a DOM node before it exists (init run during head parsing). Deferring initialization or moving script includes to the end of body fixes this.
  • Assuming browser-only objects exist (for example, calling methods on a null return from getElementById). Guard lookups and test for existence before use.
  • Using console logging without a console present (older IE throws when console is undefined).
  • Malformed HTML (unquoted attributes, stray tags) that changes the DOM tree and so breaks script assumptions — validate the markup.

Helpful defensive snippets (place near initialization):

if (!window.console) window.console = { log: function(){} };
window.onload = function() {
  var el = document.getElementById('menu');
  if (el) initMenu(el);
};

For third-party or generator scripts, reproduce the error in a minimal page to isolate the failing function; once the debugger shows the line and object, add existence checks or update/replace the script with a modern, smaller menu solution.

Recommended Answers

All 5 Replies

That usually occurs when IE has issues with the page javascript. In the page source code I see two main blocks of JS, one in the header, and another linked to an external file. Remove the big block in the header, then run the page again. If the error is no longer there, then you know it's the big block in the header. From there you can start to decipher the offending JS line/s of code. You could also try it the other way around, leave the big block of code in the header, and remove the link to the external. Let's hope that only one creates the error and not both cases.

That usually occurs when IE has issues with the page javascript. In the page source code I see two main blocks of JS, one in the header, and another linked to an external file. Remove the big block in the header, then run the page again. If the error is no longer there, then you know it's the big block in the header. From there you can start to decipher the offending JS line/s of code. You could also try it the other way around, leave the big block of code in the header, and remove the link to the external. Let's hope that only one creates the error and not both cases.

Thanks for the input, I deleted the javascript in the header and copied ti to the mm_ file, and I still get the "Done with Errors" notification, this is what it says when I click on it:

Line: 16
Char: 1
Error: Object required
Code: 0
URL:

This has been consistent, and so far the only thing on line 16 is the closing </head> tag so I'm not sure what it's referring to. Could it be line 16 in the javascript???

Thanks!

I think you mis-understood. It's not a problem that the code existed between the head tags, what I was saying was to remove the code and test the page without the code. Once there were no more errors, you know that the block of code was creating the issue, then from there you can go through line by line within the block of code to find the JS piece that was creating the issue.

If the errors still existed, then you put back your code within the header, then remove <script language="JavaScript" src="mm_" type="text/javascript"></script> to the menus. Yes, I the menus will not work temporarily, but you are trying to find out which set of code is causing the problem.

I think you mis-understood. It's not a problem that the code existed between the head tags, what I was saying was to remove the code and test the page without the code. Once there were no more errors, you know that the block of code was creating the issue, then from there you can go through line by line within the block of code to find the JS piece that was creating the issue.

If the errors still existed, then you put back your code within the header, then remove <script language="JavaScript" src="mm_" type="text/javascript"></script> to the menus. Yes, I the menus will not work temporarily, but you are trying to find out which set of code is causing the problem.

It was the mm_ Link that caused it... Thanks! YOU ROCK!!!!!

Hi,

Just to let you know so that code is good you also have a number of other errors in your code:

Line 10: link tag type should read "image/png" not "image.png"
Line 54: The default scripting language hasn't been specified for the onclick event. Put this line of code in your in the head section.

<meta http-equiv="Content-Script-Type" content="text/JavaScript" />

Line 169 and 170: input tags should have matching end tags as in:

<input .. .. />

Line 169 and 170: The type and name attributes inside your input tags should be wrapped in quotes "..."

Cheers

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.