PDA

View Full Version : anylinkcss.htm ie 5-7 problem



yellowcake
02-09-2009, 10:46 AM
http://www.dynamicdrive.com/dynamicindex1/anylinkcss.htm

I have a problem with this script. It seems to be working fine in opera, safari, firefox on mac and firefox + IE 8 on PC - but IE 5, 5.5, 6 & 7 throws this error message.

"could not complete the operation due to error 80004004 " then whe hit ok the browser shows a generic load failed page.

After a bit of digging around ive found some info regarding the DOM structure, but to no avail. Then it suggested trying a "onContentRead" but im not sure how to implement this.

here is the page the menu is living on and any info would be greatly appreciated.

http://www.emfour.com.au/index2.html

Cheers
yellowcake at midcoast dot com dot au

jscheuer1
02-09-2009, 03:36 PM
That error in IE generally means that a script is trying to write into a portion of the document where there is a problem due to invalid code. Your entire page is invalid (don't get too upset, it just means that it doesn't conform to standards).

Required opening and/or closing element tags are missing in some cases, and there is no DOCTYPE, elements appear in areas where they are not allowed, required attributes are missing, non-standard attributes are used.

If you have a valid document, it is much less likely that you will get this sort of error in IE. However, as far as IE 5 goes I make no guarantees.

You may use the w3c validator:

http://www.w3.org/

But it is also possible that if you just make sure that IE is 'happy', things may just work out. In the long run, a valid document is best, but this is a quick fix:

Now, the script already states that this part:


<script type="text/javascript">

//anylinkcssmenu.init("menu_anchors_class") //call this function at the very *end* of the document!
anylinkcssmenu.init("anchorclass")
</script>

So remove it from where you have it, and place it here:


<script type="text/javascript">

//anylinkcssmenu.init("menu_anchors_class") //call this function at the very *end* of the document!
anylinkcssmenu.init("anchorclass")
</script>
</body>
</html>

just before your closing </body> tag. That much should be done no matter what.

Here comes the part where we make IE 'happy' - Place these in front of it:


</div></span>
<script type="text/javascript">

//anylinkcssmenu.init("menu_anchors_class") //call this function at the very *end* of the document!
anylinkcssmenu.init("anchorclass")
</script>
</body>
</html>

That closes tags that were left open, enough at least that IE 7 can now display the page.

yellowcake
02-13-2009, 10:58 AM
Woohoo! ... it was my crappy coding :-) Thankyou very much... that was the problem allright.

Cheers
yellow