Please help me correcting error for validating site

Discussion in 'HTML & Website Design' started by andriusk, Jan 21, 2006.

  1. #1
    I try to validate my site http://www.bumas.lt and I got error

    I can't find anywhere how should I correct this except deleting that language='JavaScript', but I'm afraid in doing this because I'm not sure if that can be deleted.

    Can you help me to solve the problem or just to show the way where to search for solving this problem?

    Thank You.
     
    andriusk, Jan 21, 2006 IP
  2. tresman

    tresman Well-Known Member

    Messages:
    235
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    138
    #2
    The Languaje attribute is deprecated in the Doctyope declaration you are using.

    Simply delete that code from there And do not worry, no problem at all.
     
    tresman, Jan 21, 2006 IP
  3. Corey Bryant

    Corey Bryant Texan at Heart

    Messages:
    1,126
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Corey Bryant, Jan 21, 2006 IP
  4. Amsterdam

    Amsterdam Well-Known Member

    Messages:
    361
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    128
    #4
    Yes, change the 'doctype' declaration to "transitional" instead of "strict" and all should be well.

    T
     
    Amsterdam, Jan 21, 2006 IP
  5. the_pm

    the_pm Peon

    Messages:
    332
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    0
    #5
    There's no need to compromise your doctype to accommodate your scripts. Just clean up your <script> tags:

    <script type="text/javascript" src="link_to_script.js">

    That will make your tag both valid and well-formed.
     
    the_pm, Jan 21, 2006 IP
  6. andriusk

    andriusk Well-Known Member

    Messages:
    367
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    140
    #6
    Thanks for your answers.
     
    andriusk, Jan 21, 2006 IP
  7. andriusk

    andriusk Well-Known Member

    Messages:
    367
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    140
    #7
    Can you help me with one more problem?

    As I checked http://www.w3schools.com/tags/tag_a.asp the target element can be used and I need it for links to be opened in new page.

    Do you have any ideas how can I solve this problem?

    Thank You.
     
    andriusk, Jan 22, 2006 IP
  8. Corey Bryant

    Corey Bryant Texan at Heart

    Messages:
    1,126
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Corey Bryant, Jan 22, 2006 IP
  9. FeelLikeANut

    FeelLikeANut Peon

    Messages:
    330
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #9
    I think the_pm said it best, "Popping open a new window has simply been transferred to the realm of behavior instead of structure, so it moves into JavaScript."

    So, in place of the target attribute, you will have this:
    <a href="http://www.w3.org" [color=red]onclick="window.open(this.href); return false"[/color]>
    Code (markup):
     
    FeelLikeANut, Jan 22, 2006 IP
  10. andriusk

    andriusk Well-Known Member

    Messages:
    367
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    140
    #10
    Thanks for your answers, just I do not understand the point why target is bad? Do you have any ideas what were the reasons throwing it away from Strict validation?
     
    andriusk, Jan 22, 2006 IP
  11. the_pm

    the_pm Peon

    Messages:
    332
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    0
    #11
    I've heard a few explanations for this, but the most compelling one I've heard is that the target attribute fundamentally breaks expected browser usage. Typically, when the target attribute is invoked, it causes a new application to open up on someone's computer. The nature of the element makes it compulsory - the end user cannot prevent this behavior from taking place.

    Removing target in favor of window.open returns control back to the user, which is precisely where it should have been all along. The new window is now a suggested behavior, not a mandatory one. Most users will have no problem with site authors who use window.open, but the few who don't care for this have the option to ignore it. This is a very desirable thing, and in some cases, it is a necessary thing. For example, imagine the confusion a blind person experiences whenever a new browser window is opened. Suddenly, the expected forward and back button interaction no longer applies.

    This same reasoning is fundamental to the idea of style and structure separation as well, as user-defined style sheets are becoming increasingly popular.
     
    the_pm, Jan 23, 2006 IP
    tresman likes this.
  12. andriusk

    andriusk Well-Known Member

    Messages:
    367
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    140
    #12
    After I placed

    I get new error

     
    andriusk, Jan 28, 2006 IP
  13. tresman

    tresman Well-Known Member

    Messages:
    235
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    138
    #13
    Most probably you put an a element, which is an inline element, but not enclosed on a block element. You must,

    If you do not understand this, please post a bit more of the code before and after and I'll explain you.
     
    tresman, Jan 28, 2006 IP
  14. andriusk

    andriusk Well-Known Member

    Messages:
    367
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    140
    #14
    <script type='text/javascript' src='http://www.bumas.lt/ads/adx.js'></script>
    <script type='text/javascript'>
    <!--
    if (!document.phpAds_used) document.phpAds_used = ',';
    phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);

    document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
    document.write ("http://www.bumas.lt/ads/adjs.php?n=" + phpAds_random);
    document.write ("&amp;what=zone:1&amp;target=_blank&amp;block=1&amp;blockcampaign=1");
    document.write ("&amp;exclude=" + document.phpAds_used);
    if (document.referrer)
    document.write ("&amp;referer=" + escape(document.referrer));
    document.write ("'><" + "/script>");
    //-->
    </script><noscript><a href="http://www.bumas.lt/ads/adclick.php?n=af153bb8" target="_blank"><img src='http://www.bumas.lt/ads/adview.php?what=zone:1&amp;n=af153bb8' border='0' alt=''></a></noscript>
     
    andriusk, Jan 28, 2006 IP
  15. tresman

    tresman Well-Known Member

    Messages:
    235
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    138
    #15
    Where on the above can I found "...window.open(this.href); return false"><img src='http://www.bumas.lt/ads/advie...·?

    Anyway, I'll try it:

    Something like <a href="http://whatever.com">Anchor Text here</a> is not anymore valid if you are suing the Strict DTD. You should put the a element inside a block one, like <p>, <blockquote>, table...

    This is valid: <p><a href="http://whatever.com">Anchor Text here</a></p>

    BTW: the target blank (see the nioscript) is also not valid on that DTD. Maybe you should change to transitional, which is slightly more flexible.
     
    tresman, Jan 28, 2006 IP
  16. FeelLikeANut

    FeelLikeANut Peon

    Messages:
    330
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #16
    What the error is saying, andriusk, is that any inline element, such as an A element or even just plain text, must be part of a block element: you must say what the text is a part of. Is it part of a paragraph? Part of a heading? Part of an address? And so forth.
     
    FeelLikeANut, Jan 28, 2006 IP
  17. andriusk

    andriusk Well-Known Member

    Messages:
    367
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    140
    #17
    This code is from phpAdsNew and it is in div id=banner, which is described as #banner {
    width: 468px;
    margin-left: auto;
    margin-right: auto;
    }
     
    andriusk, Jan 28, 2006 IP
  18. FeelLikeANut

    FeelLikeANut Peon

    Messages:
    330
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #18
    That is like declaring you will eat healthy, then abandoning the idea because you had a craving for a donut. We give ourselves stricter rules to follow so that we can clean up and/or better organize our coding habits. We shouldn't run back to the transitional doctype whenever we hit a snag; we should try to understand why the new alternative that strict forces us to use is considered better.
     
    FeelLikeANut, Jan 28, 2006 IP
  19. tresman

    tresman Well-Known Member

    Messages:
    235
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    138
    #19
    Ahhh... isn't that donut delicious but? :D

    Now seriously: I completely agree with you. However, we should know when we are ready for the next step. He doesn't seems to know the difference yet between inline elements and block ones and what semantics on the web are and mean.

    Usually, I would recommend to learn to do the things on the right way at first and don't get bad habits. But sometimes I will simply say: come on man, eat that donut and don't worry anymore!

    In fact, the thing right know is: is he trying to have a valid site or trying to have a Strict valid site. If the last, why did he choose Strict? He could also have a 1.1 Strict served in xhtml for compatible browsers but parsed and converted to HTML 4.1 for the rest. And that would be THE RIGHT way. But this would be quite work.

    It simply depends on how I feel that day, and today I'm really tired!
     
    tresman, Jan 28, 2006 IP
  20. FeelLikeANut

    FeelLikeANut Peon

    Messages:
    330
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #20
    lol. I know what you mean there. :)
     
    FeelLikeANut, Jan 28, 2006 IP