View Full Version : DD Tab Script - Object Required Error

08-25-2006, 05:39 PM
1) Script Title: DD Tab Menu

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/ddtabmenu.htm

3) Describe problem: I'm getting an "Object required" error in IE when running this script.

The script runs fine in a stand-alone mode (see http://www.ni-econdev.com/sitesearch.asp?p=gledc) but when it is incorporated into an iframe the error pops up. (see http://www.gledc.com/available.asp). I should note that the script runs fine in the initial iteration but breaks down when trying to follow a link in the iframe window. The line of code indicated as the culprit is document.getElementById(cid).style.display="block"

The script executes fine in Firefox and a check of the javascript consolde indicates no problems.

Any advice?

08-25-2006, 08:09 PM
There are a couple of css errors reported in FF, in IE and FF though, it works fine here (even in the iframe) with no script errors reported. Are you using IE 7 or possibly IE Mac?

08-25-2006, 09:08 PM
I'm using IE 6.0.

Here's what's puzzling about the problem I have. If you open the standalone page first, then the iframes page will open later. If you close and repopen your browser and open the iframes page first, then the error occurs. If I knew much about javascript I could probably figure this out. It seems that a variable is being lost in the iframes environment that isn't lost otherwise. Once the non-iframes page is run, then the variable is retained in javascript and is available later when the iframes page is opened. By the way, just to be clear, the iframes problem occurs a couple steps in. Open the page, search for properties and the error pops up when clicking on a property link to see detailed information.

08-26-2006, 08:03 AM
Why didn't you say so in the first place? Anyways, the error I got was:

line: 34
char: 1
Object required
Code: 0
URL: http://www.ni-econdev.com/sitesearch.asp?

Since that page isn't even on your site, you have no way of fixing it yourself. You could report it to the site's webmster and/or owner.

08-26-2006, 08:17 AM
Ah, looking back at your initial post, it appears as though you may have control over that page. In that case try:

if (cid&&document.getElementById(cid))

08-30-2006, 03:27 PM
Thanks for your advice. I've tried to implement your suggestion but it doesn't help. It just seems that in the iframes environment that values for javascript variables are being forgotten as the script processes. Any further thoughts?

08-30-2006, 04:53 PM
I would think that if that is the case, implementing the suggestion should have at least gotten you a new error, did it?

08-31-2006, 01:24 AM
Yes and no. No javascript errors occur but the page that should display is not displayed and a vbscript error occurs after returning about 1,000 incorrect results of the original search. Keep in mind that the asp script and the dd menu work fine until put into the iframes page and also work fine in firefox. It's only in IE (6.0) and inside an iframe that any problems occur. I appreciate you continuing to follow my dilemma. Thanks!