Click to See Complete Forum and Search --> : Not Valid XHTML 1.0 Transitional! - who gives a crap?
iltlo
10-27-2007, 02:27 PM
I checked my website on the w3 html validator, and it said I had 86 errors. Now here's the question... who cares? The website looks and works perfectly fine. Why does it matter if my html is perfect? It's not like you get any errors or anything when you view the site.
ryanbutler
10-27-2007, 03:24 PM
Did you write and validate your code for HTML or XHTML? There's a difference. Personally, most web sites have a XHTML DOCTYPE but they serve their page as text/html so therefore, you have no benefit of XHTML. I personally don't see a need to write XHTML, but that's a personal decision.
As to your question regarding why you should care, it's kind of like writing a paper in Word for an English class. You might not care if Word doesn't agree with a couple things in your paper but if you have tons of spelling and grammatical errors, you wouldn't think about turning it in for a grade. Validating your page is similar, if there are a couple of errors that your page has that you have to have, then it makes practical sense to use it. If however, you have 86 errors, it indicates a severe problem with how your web page will work with various technologies and you should think about the implications.
You have to keep in mind the render time of a web page. If you have a lot of bad markup, it takes twice as long for your web page to render to the client browser. If you have a lot of errors in your web page regarding accessibility then people with disabilities can't view your web page the same as others, which can lead to liability issues and leave your web page or website open to legal problems.
Sure, no one but people on these forums would know about it, but there are implications to not fixing the errors. Most are simple grammatically errors with your markup. I'm sure people who drive drunk think there's nothing with it because they're not able to think objectively and no one will care because they technically don't know about their decision at the time but it will have implications if they hit someone and hurt them.
I don't always agree with the W3C's decisions, but it certainly doesn't hurt to run your pages through to make sure there are no glaring problems.
Hope it explains in a more practical manner than just the typically geek approach.
iltlo
10-27-2007, 03:28 PM
<META name="resource-type" content="document">
Ok, it says that in the above, "name" isn't a known attribute, but probably every website has this so they get in the results for search engines. And everyone uses this same code, so how could it be wrong?
ray326
10-27-2007, 03:44 PM
No, I believe it's saying META is not an element and it isn't. The element is meta, not META.
NogDog
10-27-2007, 03:49 PM
<META name="resource-type" content="document">
Ok, it says that in the above, "name" isn't a known attribute, but probably every website has this so they get in the results for search engines. And everyone uses this same code, so how could it be wrong?
Probably the actual source of the error is that if you are using a XHTML doctype, then tag names must be lower-case to be valid. I'd bet that changing it to "<meta name=...>" would get rid of that error.
As to why you want to get rid of [X]HTML errors, when you have invalid [X]HTML mark-up, you force the browser to "guess" what you really intended. Now, certain errors are so common -- such as using upper-case tag names in XHTML documents -- that most browsers will guess correctly. Other errors can be so drastic that most browsers will all fail to guess and will either ignore the mark-up in question or be fairly similar in how they deal with it. Then there are the in-between cases where different browsers will guess differently and output significantly different results. But, when you have completely valid mark-up, there is no need for any browser to guess what you meant, and each should correctly and exactly understand your intentions.
iltlo
10-27-2007, 03:56 PM
Ok I get it now. I'm gonna be using this a lot now.
Is there a php validator?
NogDog
10-27-2007, 04:47 PM
Ok I get it now. I'm gonna be using this a lot now.
Is there a php validator?
Well, technically the PHP parser is, since it throws a parse error if your PHP is formatted incorrectly. :) I think some of the IDE's available for PHP (such as from Zend.com) have options to run your code through the parser but not actually executing it, then displaying any parse errors. Also, if you turn on all errors and notices for display while in development, you should find pretty much any suspicious code -- but no such validation will find logic errors on your part.
<?php
// for debug only, turn off display_errors in production
ini_set('display_errors', 1);
error_reporting(E_ALL | E_STRICT);
// rest of script...
?>
Stephen Philbin
10-27-2007, 05:26 PM
...The website looks and works perfectly fine...
It's a common mistake to equate "looking" fine to "working" fine.
I've seen plenty of pages which probably "look" fine on Microsoft Internet Explorer 6 installed on Windows XP and has Javascript enabled, yet fails quite spectacularly in almost every respect when it comes to "working". A web page is not a picture, it's a resource.
iltlo
10-27-2007, 08:33 PM
Ok, this is a different kinda question but w/e
How do I allow the copyright sign to show up on my site? It just has a question mark instead.
NogDog
10-28-2007, 01:26 AM
You can use the © character entity.
Kravvitz
10-28-2007, 01:31 AM
Or the numeric entity: (which will work in HTML and XML parsers)
©
Here's another thread on this topic: So what if my coding doesn't validate? (http://www.webdeveloper.com/forum/showthread.php?t=127809)
Jeff Mott
10-28-2007, 10:10 PM
I checked my website on the w3 html validator, and it said I had 86 errors. Now here's the question... who cares? The website looks and works perfectly fine. Why does it matter if my html is perfect? It's not like you get any errors or anything when you view the site.Because, like in any software, most bugs and problems later on stem from bad practices in the beginning. Would you ignore warnings from the PHP interpreter? Or from a C compiler? Probably not. And you shouldn't ignore warnings from the HTML validator either. Just because browsers let you get away with lazy coding doesn't mean you should do so.
WebJoel
10-30-2007, 05:11 PM
So I assume that we have another convert? :p Coming into a web developer forum and suggesting that writing good, solid & compliant, validating code is not necessary or a waste of time it like going to the finest international cooking school and bad-mouthing French cuisine... you're going to be in a serious minority. :D
harumph
11-01-2007, 08:34 AM
(Run this site thru the validator --- shhhh. Don't tell 'em)
WebJoel
11-01-2007, 02:34 PM
Yeah, -that came up in Forum Feedback recently... verdict was that it would take too long to re-do WD to current standards.
Too bad... it might make it load-up a bit faster than it does sometimes.. :p And this site is hardly new. New builds should adhere to current standards. Updated sites that require legacy models, transitional.
Older sites are/should be attritable if a modern browser ceases to be charitable towards them.
bobpalin
11-01-2007, 03:30 PM
No, I believe it's saying META is not an element and it isn't. The element is meta, not META.The ultimate stupidity, forcing humans to behave like computers instead of computers to be like humans, 'meta' is the same as 'META'! (It's like saying bob and Bob are two different names)
scragar
11-01-2007, 03:40 PM
actually, bob is not a name, without capitalisation I wouldn't even say it counts as a proper noun.
and full caps is just rude, I'm not surprised the computer rejects it :P
harumph
11-01-2007, 03:49 PM
bob is a verb, isn't it?
harumph
11-01-2007, 03:54 PM
Bandwidth is a non-issue now (ftmp). Yea. I have several sites I need to redo, myself. All my new stuff is [basically] complying, and I HAVE been going back and fixing some glaring soon-to-be obstacles on a few of them. It's still a moving target.
I was just messing with you :D . Talk about a PITA to fix it. Especially with the traffic you guys pull.
bobpalin
11-01-2007, 05:28 PM
bob is a verb, isn't it?damn :) Why didn't I choose susan!
This thread is actually apropos to me, yesterday somebody pointed out all the errors on my php generated pages (nearly 100) so I fixed them, all except the _target one which I don't know how to fix. And the warning about <br /> which I don't want to fix.
harumph
11-02-2007, 11:17 AM
damn :) Why didn't I choose susan!
lol. Yea, but someone would shorten it to Sue.
That's a verb, too.
capnjeremy
11-02-2007, 03:07 PM
Another thing that no one really touched on is that XHTML is a standard, which means browsers [should] comply with it. If you make non-standard code, and a browser gets updated, it could totally break your site. If you rely on hacks for making your site "look" right, chances are they will break with the next major browser update.
harumph
11-02-2007, 03:14 PM
And this is the key: XHTML is a standard not the standard. Many people choose NOT to use XHTML for reasons valid to them. JavaScript is a standard (of sorts) but many people choose to avoid that as well.
drhowarddrfine
11-03-2007, 12:15 PM
XHTML is a "de facto" standard and a 'recommendation' actually, and unfortunately.
David Harrison
11-03-2007, 01:22 PM
Heh.Most are simple grammatically errors
drhowarddrfine
11-04-2007, 09:14 PM
Wax on. Wax off.