0

Ok so here is the deal, I am implementing a new navigation menu and footer to a site built with asp. Most of the pages have an include at the top of the page before the Doctype html tag. When I add my include file for my head tag (has my css links) and includes to add the new navigation/footer, the header and footer do not work in Internet Explorer. So essentially here is what a page will look like.

<!-- #include file='includes/pageincludes/namesearch_top.asp'-->
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]-->

<head>

<title>State Index Searching - Plat Index&nbsp;<%=txtTitle%></title>
<script LANGUAGE="JavaScript" SRC="/includes/cookie.js"></script>
<!-- #include file='myHeadContent.asp' -->      
</head>
<body>
<!-- #include file='top_Nav.asp' -->
<!-- #include file='pageContent.asp' -->
<!-- #include file='footer.asp' -->
</body>

</html>

The namesearch_top.asp file has more includes that contain scripts to validate user login info, dates, etc. What could be the problem ?

3
  • Your information's are not enough to get any answer. Maybe if you have a live url to see whats run. Also is this asp.net or simple classic asp ? - I change the tag to asp-classic because I do not see any asp.net here
    – Aristos
    Jan 3, 2013 at 21:27
  • View your html source code in IE. Often that will give you a clue as to what is breaking. Just a guess, perhaps an unclosed tag.
    – CM Kanode
    Jan 3, 2013 at 21:29
  • it is classic asp, I can't really provide a live url since I am working via VPN and you must be connected that way to see the site. I realized that the namesearch_top.asp file has javascript in it (used for validation) and if I remove the Javascript, the header/footer works. Would it be ok to move the Javascript code into the main file in the head tag?...Thanks for your help Jan 3, 2013 at 21:36

1 Answer 1

1

You are including namesearch_top.asp before the DOCTYPE declaration, and that will be forcing IE into quirks mode if it is adding CSS and JavaScript links as you describe. Move it inside the head element.

1
  • Yes, but if it outputs anything (e.g. CSS links, script, etc.) it forces IE into quirks mode.
    – webaware
    Jan 3, 2013 at 21:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.