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.
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.
Yes, change the 'doctype' declaration to "transitional" instead of "strict" and all should be well. T
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.
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.
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):
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?
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.
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.
<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 ("&what=zone:1&target=_blank&block=1&blockcampaign=1"); document.write ("&exclude=" + document.phpAds_used); if (document.referrer) document.write ("&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&n=af153bb8' border='0' alt=''></a></noscript>
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.
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.
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; }
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.
Ahhh... isn't that donut delicious but? 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!