Forum Moderators: open

Message Too Old, No Replies

HTML Validation and Netscape

Validating pages that then don't work in Netscape

         

Wishful

1:04 pm on Jun 26, 2003 (gmt 0)

10+ Year Member



Hi there

I'm developing a site (my first really big one) using Javascript navigation menus. Everything with the menus was working well until I did some work on trying to make my pages validate for HTML4.01 Transitional. The main page of the site validates (I only had to change the full DOCTYPE and one or two meta tags now, however, my lovely menus (which drop down from a menu bar near the top of the page) display beautifully in Opera and IE, but Netscape 6 and 7 now show each menu butted up right against the top left of the window, whichever one I mouse over. If I made the simple change to putting the DOCTYPE back to how it was, the menus work fine in Netscape. Also, Netscape 6 drops the bar from which the menus come down a few pixels with the correct DOCTYPE in place, but 7 leaves that where it should be.

Could anyone point me in the direction of some information that might explain why this might be happening.

Thanks in advance

Wishful

drbrain

5:27 pm on Jun 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What is the exact doctype you are using?

Wishful

7:53 am on Jun 27, 2003 (gmt 0)

10+ Year Member



Hi there

The exact DOCTYPE line I'm using is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Thanks

Wishful

scotty28

2:53 pm on Jun 27, 2003 (gmt 0)

10+ Year Member



Wishful,

I experienced a similar problem before. Try to map your menu to a div tag, try something like

<div id='some_id' style='position:relative; width:?; height:?;'>
insert a transparent image here with width and height the same as within the div tag
</div>

Now create some javascript to map the menu to the div tag

hope this helps

dingman

3:28 pm on Jun 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



somewhere, I have some code that does drop-down menus in javascript that works in IE, Opera, and Gecko browsers. I forget whether it works in Konqueror or not, but with Safari out there it's worth remembering, too.

I used a nested div approach and if I remember right absolute positioning. The positioning was a bit of a trick to get right across browsers, and I seem to recall discovering that I couldn't line the new div's up with their parents propperly with both IE and anything else, because IE used it's own DOM instead of the official one, so the right objects weren't there. I *think* Opera supports more of the IE perversions of the DOM than Gecko, so it's possible you're running into the same thing.

Hope that helps at least a little. I'll see if I can dig up that menu code for you, but since the whole site got scrapped a month or so later I'm not too confident.

Wishful

3:35 pm on Jun 30, 2003 (gmt 0)

10+ Year Member



Thanks for all your suggestions.

After lots of detective work, it turned out to be a problem with the inclusion of px on the end of the integer that dictated the top and left positioning.

However, everything you have said will I'm sure come in useful in other situations!

Thanks again

Wishful

g1smd

8:04 pm on Jun 30, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Search engines cannot follow some Javascript written links, so make sure you put a normal HTML link on every one of your pages which is pointing to a sitemap page that you develop. This sitemap page should contain a normal HTML link back to every single page of your site. It will be followed by robots and spiders, and by people surfing with javascript turned off, or who are simply using browsers that do not have javscript at all (like screen readers for disabled people). Make sure that you put all your javascript code into an external file. This means that you can use the same file in every page (minimising your time to update the whole site), and the site should work more quickly as the javscript file can be cached by the browser when visitors hit the first page. It will also lower the bandwidth that your site uses.