Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 12 of 12
  1. #1
    Regular Coder
    Join Date
    Oct 2006
    Posts
    164
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Gap issue when doctype changes

    Hello, I have a page that i didnt code but am recoding it to be xhtml 1.1 valid. I have gotten it so the page is valid xhtml 1.1 without any errors but i just noticed that when i change the doctype to anything above 1.0 trans, a gap appears in the dropdown menu. I have no idea whats wrong or how to fix it. The pages below are the same page but with different doc types.

    1.0 trans page with no issues - REMOVED

    1.0 strict page with gap issue - REMOVED
    Thank You!

    Note: This looks fine in IE7, so try not to use it.
    Last edited by Sman5109; 07-18-2007 at 07:09 AM.
    Not much, but its something.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    If you don't know how to pass the application/xhtml+xml header then don't use an XHTML 1.1 doctype.

    For information about the gaps read this
    http://developer.mozilla.org/en/docs...ysterious_Gaps
    It doesn't only apply to tables.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Regular Coder
    Join Date
    Oct 2006
    Posts
    164
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Ok, i added a css something and that fixed the gap. And i know how to use the header. That leads me to my next problem. The page below has the xhtml 1.1 doctype and is served as application/xhtml+xml. But now when it is served as that the drop menu stops working all together. Whats wrong now?

    REMOVED
    Last edited by Sman5109; 07-18-2007 at 07:09 AM.
    Not much, but its something.

  • #4
    Senior Coder koyama's Avatar
    Join Date
    Dec 2006
    Location
    Copenhagen, Denmark
    Posts
    1,246
    Thanks
    1
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by Sman5109 View Post
    The page below has the xhtml 1.1 doctype and is served as application/xhtml+xml. But now when it is served as that the drop menu stops working all together. Whats wrong now?

    http://toogr.net/elivalidtest85974596/indexrender.php
    I don't think that you can use document.write in XHTML. Your JavaScript contains such statements.

    Anyway, what is the point using XHTML? Are you doing this as an exercise?

  • #5
    Regular Coder
    Join Date
    Oct 2006
    Posts
    164
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Ok, i know nothing about JS, what do i replace the document.write with? The only instance of it is Here on line 60.

    Anyway, what is the point using XHTML? Are you doing this as an exercise?
    Its called Future Proofing.
    Not much, but its something.

  • #6
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    I suggest you use a different menu. Try creating one from scratch. Its not that hard. Your menu relies on javascript to even work meaning users with JS disabled see no menu including search engines. If you are so worried about future proofing then I suggest you redo your menu using normal unordered lists so it doesn't rely on JS to be enabled. Who knows in the future JS could no longer exist (not likely) but you never know.

    http://www.alistapart.com/articles/dropdowns/
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #7
    Regular Coder
    Join Date
    Oct 2006
    Posts
    164
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Yeah, thats what i thought. That damn coder just did it because it was the easiest and fastest way of getting it done. Stupid coder

    BTW, if im going to create a new menu i want to do one that is completely CSS. Do you have a good tut for one?
    Last edited by Sman5109; 07-18-2007 at 07:07 AM.
    Not much, but its something.

  • #8
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Why don't you try clicking the link in my post?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #9
    Regular Coder
    Join Date
    Oct 2006
    Posts
    164
    Thanks
    5
    Thanked 0 Times in 0 Posts
    I did, but at the end it wants you to add some JS:

    Code:
    startList = function() {
    if (document.all&&document.getElementById) {
    navRoot = document.getElementById("nav");
    for (i=0; i<navRoot.childNodes.length; i++) {
    node = navRoot.childNodes[i];
    if (node.nodeName=="LI") {
    node.onmouseover=function() {
    this.className+=" over";
      }
      node.onmouseout=function() {
      this.className=this.className.replace(" over", "");
       }
       }
      }
     }
    }
    window.onload=startList;
    Not much, but its something.

  • #10
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    That JS is for IE6. IE6 doesn't support :hover on non-link elements. Personally I would use the menu in the link I provided however if you still prefer not to use JS then its going to be a little more work and probably give you a headache.

    http://cssplay.co.uk has some full CSS menus that don't use javascript but it uses a ton of IE conditional comments to feed it invalid html. Koyoma will likely say something like "I don't mind feeding invalid html to a non standards browser."
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #11
    Regular Coder
    Join Date
    Oct 2006
    Posts
    164
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Ok , thank you for your help.
    Not much, but its something.

  • #12
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,609
    Thanks
    0
    Thanked 645 Times in 635 Posts
    Since even IE 8 is not going to support XHTML there is no reason for including that JavaScript for the menu if you always serve the page as XHTML since the only browser that needs the JavaScript will be unable to process any of the page content to start with. It is only if you are going to change the header to serve the page as HTML to IE that you will need that JavaScript.

    The other problem with that JavaScript is that it doesn't restrict itself to IE6 as it ought to but will also run unnecessarily in IE7 and all recent versions of Opera. If you are going to use it then get rid of the

    if (document.all&&document.getElementById) {

    test and place the entire JavaScript in conditional comments testing for IE6.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •