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.
Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Victoria, BC, Canada
    Posts
    962
    Thanks
    0
    Thanked 1 Time in 1 Post

    XHTML Validator questions

    I ran my framed website through the W3C XHTML validator. it returned 3 errors: no attributes called framespacing and frameborder. Also, it says the element <noframes> is not allowed. What's going on? Here's the link to the result page, with the error highlighted: check it out, and please let me know of any solutions.

    http://validator.w3.org/check?uri=ht...tomatically%29

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    NL
    Posts
    421
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Framespacing is deprecated in xhtml 1.0 strict. Frameborder and noframes were in the wrong place.
    This is valid:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html;  charset=ISO-8859-1" />
    <meta name="Heroes of Might and Magic 1" content="HOMM, Heroes of Might and Magic, A Strategic Quest, artifacts, heroes, troops, castles, towns, spells, skills, scenarios, campaigns, pictures, strategies, cheats, links, downloads, where to buy, 3DO, New World Computing, NWC" />
    <title>Index</title>
    </head>
    <frameset cols="12%, *">
    <frame src="pagelinks1.html" name="left_frame" scrolling="no" frameborder="0" noresize="noresize" />
    <frameset rows="13%, *">
    <frame src="pagelinks2.html" name="top_frame" scrolling="no" frameborder="0" noresize="noresize" />
    <frame src="home.html" name="bottom_frame" scrolling="auto" frameborder="0" noresize="noresize" />
    </frameset>
    <noframes>
    <body>
    <p>Your web browser does not support frames.  To view the the site, you should use the <a href="SiteMap.html">Site Map</a></p>
    </body>
    </noframes>
    </frameset>
    </html>

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I would avoid frames anyway (I posted a few times regarding this subject on the old forums!). I just think they cause many more problems than they solve (look up something like "pros and cons of frames" on google), although there are a few (rare) valid cases where they are the best option.

    I would use include files, or (if you can't use server side scripting at all, or even SHTML includes) javascript includes for menus, etc. before I would use frames.

    I would opt for getting an SHTML enabled host at the very least, though.
    Last edited by whammy; 11-23-2002 at 12:53 AM.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    Victoria, BC, Canada
    Posts
    962
    Thanks
    0
    Thanked 1 Time in 1 Post
    MCookie, thanks for those fixes. The page validates now. However, I have a small problem. I was using the framespacing attribute to keep my frames up against each other, but now, without that attribute, they are slightly spaced apart. Do you know how that can be fixed? Take a look at the page I've been talking about and you'll see what I mean: there's a small white border between the frames.

    http://www.freewebs.com/hommworld/Homm/index.html

    Whammy, thank you for your input. I have weighed the pros and cons of using frames before. I even asked here about it some time ago. One good thing about them is that they keep all the navigation in sight, whereas if I included the navigation stuff on the same page, you would have to scroll to find it. I've thought of using Javascript includes, but the possible downside is that they would not work if someone has javascript disabled in their browser.
    I've tested my frames fairly carefully (at least, I think so), and everything goes where it's supposed to.
    I don't know anything about server-side, so that's out. Although I have heard about Server-Side Includes. What would you suggest?

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, that is one of the pros about using frames for navigation - it doesn't move.

    Other than that I guess it all really depends on the site, and weighing what you like about them against the cons. If you want people to be able to bookmark individual pages, or you are using a lot of frilly javascripts (which thankfully you aren't!), forget them.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Location
    Victoria, BC, Canada
    Posts
    962
    Thanks
    0
    Thanked 1 Time in 1 Post
    What's wrong with javascript with frames???

    I have another problem now. I'm trying to validate the two pages that contain navigation links: the top frame, and the left frame. They are named PageLinks1 and PageLinks2. When I run those pages though the validator, I get the same two errors for each: the body element is not allowed, and missing a required sub-element of the HTML tag. Could you please have a look and point out to me what's wrong? I've looked them both over a few times, and I haven't got a clue. Here are the lnks to each int he validator:

    http://validator.w3.org/check?uri=ht...tomatically%29

    http://validator.w3.org/check?uri=ht...tomatically%29

  • #7
    Regular Coder
    Join Date
    Jun 2002
    Location
    NL
    Posts
    421
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Be sure to use the right DTD. For a frameset page, you need the frameset DTD. But on other pages, use the strict or transitional DTD. If you use a frameset DTD, the validator looks for a frameset. If it isn't there, your page won't validate.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">


    But when you've put the right DTD there you'll get these results for Pagelinks1.html:

    Line 21, column 17:
    <body background="NavGradient.jpg">
    Error: there is no attribute "background" for this element (in this HTML version)

    Line 23, column 17:
    <script language="JavaScript1.2" type="text/javascript">
    Error: there is no attribute "language" for this element (in this HTML version)

    Line 53, column 7:
    <center>
    Error: element "center" not defined in this HTML version

    Line 58, column 34:
    ... <a href="screenshots.html" target="bottom_frame"><img src="s ...
    Error: there is no attribute "target" for this element (in this HTML version)

    Line 58, column 50:
    ... enshots_button.jpg" width="75" height="34" border="0" alt="Screenshots ...
    Error: there is no attribute "border" for this element (in this HTML version)


    What to do?

    * 'background' is deprecated. You should use CSS for background images.

    * 'language' is deprecated. But <script type="text/javascript"> will validate.

    * 'center' is also deprecated. Use text-align:center or margins..

    * 'target'. Deprecated. Very important attribute when using frames. You need it. But, other then using JS, I've not yet seen a way to open pages in another window using xhtml strict.

    * 'border' Deprecated. Use CSS.


    For using frames, you need the framespacing and the target attributes. But these attributes don't exist in xhtml strict. Now, maybe there's a way to get rid of the framespacing, I'm not sure, but I don't think you can get around the deprecated target attribute. I think you have to make a decision here. No frames and xhtml or frames and html 4.01.

  • #8
    Regular Coder
    Join Date
    Jun 2002
    Location
    Victoria, BC, Canada
    Posts
    962
    Thanks
    0
    Thanked 1 Time in 1 Post
    Thanks for that, MCookie. I've put the Transitional DTD on all of my pages except the frameset page (index). The Index, Pagelinks1, and Pagelinks2 pages all now validate without errors.

    Do those deprecated elements apply to XHTML Transitional?

  • #9
    Regular Coder
    Join Date
    Jun 2002
    Location
    Victoria, BC, Canada
    Posts
    962
    Thanks
    0
    Thanked 1 Time in 1 Post
    Okay, I've been doing a little thinking about this.

    Background, language, center, and border will be easy enough to fix (I've even done some of it now).

    Like you said, that target attribute will be a bother. I've been playing around with my HTML, and I've got a few ideas.
    1. I could just re-insert those framespacing attributes into my frameset, and remove the XHTML DTD from my page. The downside is that it will then not be XHTML compliant.
    2. I could put all my navigation links into tables. The major downside here is the maintenance involved in changing the navigation links in each page.
    3. I could try using an IFRAME. I wouldn't mind trying it, since I've never used it before. But, first, I don't know if XHTML supports this. Second, I understand it is not supported by many browsers.
    4. I tried using Javascript includes to automatically insert the navigation links onto the content pages themselves. This worked, but I could tell that it was just a tad slow. Plus, it wouldn't work for users who do not have Javascript enabled.
    5. I've also investigated the possibility of server-side includes. It sounds like a good idea. But I'm not sure if it would be the absolute best things to do. Any opinions?

    If there are any other possibilities that I've missed, please post them!

    By the way, I'm using XHTML Transitional for the content pages, and frameset for the frameset page.

  • #10
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Server-side includes are the best way to go, if you have the ability to use them.

    target="whatever" has to be hacked right now for xhtml compliance, due to there being no XHTML equivalent. I usually use javascript i.e.:

    <a href="javascript:void window.open('link here')">link</a>

    Until they decide what to do about "new windows", etc. and frames shouldn't be a problem to manipulate with js.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #11
    Regular Coder
    Join Date
    Jun 2002
    Location
    Victoria, BC, Canada
    Posts
    962
    Thanks
    0
    Thanked 1 Time in 1 Post
    Thanks- I'll look into SSI.

    Now, that javascript targeting sounds good, but what about that number of users without javascript enabled? Or is that too few to worry about?

    And, why the heck does XHTML not support the target attribute? That seems rather dumb to me.

  • #12
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It seems dumb to me too... lol. As far as users using javascript, I suppose there may be a way to support it using a regular link as well, although I haven't messed with it.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #13
    Regular Coder
    Join Date
    Jun 2002
    Location
    Victoria, BC, Canada
    Posts
    962
    Thanks
    0
    Thanked 1 Time in 1 Post
    I already have a site map for my site- should I just direct non-Javascript users to use the sitemap to navigate, rather than through the framed page?

    Or maybe I could just ignore the non-compliance of the target attribute. Would the site still work for viewer, even though it wasn't compliant?

    I could just leave it for now and work on a long-term fix, couldn't I?

  • #14
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    Originally posted by Grant Palin
    And, why the heck does XHTML not support the target attribute? That seems rather dumb to me.
    I believe it was decided that ultimately the user should decide whether or not to open a link in a new window.

    I don't fully understand the decision myself, but I'm sure there was at least some good reasoning behind it.

  • #15
    Regular Coder
    Join Date
    Jun 2002
    Location
    Victoria, BC, Canada
    Posts
    962
    Thanks
    0
    Thanked 1 Time in 1 Post
    Well, that's crazy! Doing that, they've just about killed frames! Frames are almost useless without the target attribute, aren't they?!?


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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