|
| |
|
|
pageoneresults
Posts: 1001 From: Orange, CA USA Status: offline
|
Common HTML Validation Errors - 11/27/2002 1:02:31
There is another topic taking placed in the Intermediate/Advanced Forum concerning HTML Validation and how to address the errors. I' m going to start this thread and allow others to offer their resources and links for writing valid html and tools that can be used to help you work towards validation. The first link I' m going to post addresses the most common html validation errors. This is required reading and practice for anyone who wishes to validate their html/xhtml. [url=" http://www.htmlhelp.com/tools/validator/problems.html" ]Common HTML Validation Errors[/url]
_____________________________
SEO Consultants Directory Find Search Engine Marketing Companies
|
|
|
|
tterrifc
Posts: 690 From: Riverside CA USA Status: offline
|
RE: Common HTML Validation Errors - 11/27/2002 14:52:45
Thanks, P1R...this is really making sense to me now. One question. What do you do when the validator picks out errors in javascripts that are based on html tags?[:j] I' ve gone from 116 errors to 25. Still working it out. I' ll have more questions soon.
_____________________________
Terry Ellis http://www.protectall.com http://www.protectallshineplus.com
|
|
|
|
pageoneresults
Posts: 1001 From: Orange, CA USA Status: offline
|
RE: Common HTML Validation Errors - 11/27/2002 15:23:44
quote:
What do you do when the validator picks out errors in javascripts that are based on html tags? Can you post some examples for me? Usually they are related to unescaped ampersands. Anywhere you see this... & replace with this... & a m p ; - Eliminate the spaces between & a m p ; Ampersands (&' s) in URLs Another common error occurs when including a URL which contains an ampersand (" &" ): <!-- This is invalid html! --><a href=" foo.cgi?chapter=1§ion=2" >...</a> This example generates an error for " unknown entity section" because the " &" is assumed to begin an entity. In many cases, browsers will recover safely from the error, but the example used here will cause the link to fail in Netscape 3.x (but not other versions of Netscape) since it will assume that the author intended to write §ion, which is equivalent to §ion. To avoid problems with both validators and browsers, always use & a m p ; in place of &: <!-- This is valid html! --><a href=" foo.cgi?chapter=1& a m p ;section=2" >...</a> Get rid of the spaces in the bolded examples above. Had to put them there to prevent parsing.
< Message edited by pageoneresults -- 11/27/2002 3:27:47 PM >
_____________________________
SEO Consultants Directory Find Search Engine Marketing Companies
|
|
|
|
JohnG1974
Posts: 9 Joined: 11/6/2002 Status: offline
|
RE: Common HTML Validation Errors - 11/30/2002 0:50:27
Hello, I was trying out the W3C MarkUp Validation Service and I keep getting the following error. Fatal Error: No DOCTYPE specified! I could not parse this document, because it does not include a DOCTYPE Declaration. A DOCTYPE Declaration is mandatory for most current markup languages and without such a declaration it is impossible to validate this document. How do I know which DOCTYPE Declaration I should be using? Is there a way for FP 2000 to put that in somewhere for you? Thanks for your help.
|
|
|
|
pageoneresults
Posts: 1001 From: Orange, CA USA Status: offline
|
RE: Common HTML Validation Errors - 11/30/2002 0:55:09
Hello JohnG1974, welcome to Outfront! Most will use the HTML 4.01 Transitional DTD. It is placed at the top of your pages, in the html, before the head tag. It might look like this... <!DOCTYPE HTML PUBLIC " -//W3C//DTD HTML 4.01 Transitional//EN"
" http://www.w3.org/TR/html4/loose.dtd" >
<html>
<head>
<title>...
I have an area set up where you can read a little more about doctypes and the W3C here... [url=" http://www.seoconsultants.com/w3c/doctype.asp" ]W3C DOCTYPEs and Validation - DTD - Document Type Definition[/url] Unfortunately FP will not automatically insert DOCTYPEs for you. That would be nice, but it just ain' t so. What I do is work from a template and that contains everything I need including the DOCTYPE.
< Message edited by pageoneresults -- 11/30/2002 12:59:23 AM >
_____________________________
SEO Consultants Directory Find Search Engine Marketing Companies
|
|
|
|
JohnG1974
Posts: 9 Joined: 11/6/2002 Status: offline
|
RE: Common HTML Validation Errors - 11/30/2002 1:01:04
I' ve been working at this web design thing for a few years now and I' ve never really come across anything about this. How does this affect your page? Or does it affect it all? Thanks for your help.
|
|
|
|
pageoneresults
Posts: 1001 From: Orange, CA USA Status: offline
|
RE: Common HTML Validation Errors - 11/30/2002 1:07:14
I' m surprised that you haven' t come across this. No, wait, I' m not surprised. Less than 20% of the web validates at this moment. That means that 80% of the web cannot be seen by someone, somewhere. Why? Because we' ve been forced to use non-compliant code to make our websites work in certain browser versions that were not compliant to begin with. Its a long story and one that you' ll be reading more about from this point forward. From A List Apart... quote:
A recent DOCTYPE that includes a full URI (a complete web address) tells these browsers to render your page in standards–compliant mode, treating your (X)HTML, CSS, and DOM as you expect them to be treated. [url=" http://www.alistapart.com/stories/doctype/" ]Why a DOCTYPE?[/url]
< Message edited by pageoneresults -- 11/30/2002 1:08:34 AM >
_____________________________
SEO Consultants Directory Find Search Engine Marketing Companies
|
|
|
|
pageoneresults
Posts: 1001 From: Orange, CA USA Status: offline
|
RE: Common HTML Validation Errors - 11/30/2002 1:31:55
If you are using plain html, then the HTML 4.01 Transitional is the one to use and probably the most prevalent in use. <!DOCTYPE HTML PUBLIC " -//W3C//DTD HTML 4.01 Transitional//EN"
" http://www.w3.org/TR/html4/loose.dtd" > If you are using plain html and framesets, then the HTML 4.01 Frameset. <!DOCTYPE HTML PUBLIC " -//W3C//DTD HTML 4.01 Frameset//EN"
" http://www.w3.org/TR/html4/frameset.dtd" > Either of those two are the more common ones. If you are using xhtml, then there are three other DOCTYPEs that can be used for that. P.S. Follow the few links I' ve posted above and you' ll get a clearer understanding of the DOCTYPEs and why you need one. It' s mandatory if you are going to validate your html and css.
< Message edited by pageoneresults -- 11/30/2002 1:38:11 AM >
_____________________________
SEO Consultants Directory Find Search Engine Marketing Companies
|
|
|
|
tterrifc
Posts: 690 From: Riverside CA USA Status: offline
|
RE: Common HTML Validation Errors - 12/3/2002 17:49:01
quote:
document.all[document.all.length-1].outerHTML+=' <div id=" zBoxDiv" style=" position:absolute" ></div>' ; P1R, sorry I' m late getting back to this topic, but the above line appears in a javascript and the validation error that I received is Line83, column 98: end tag for element " DIV" which is not open (explain...) The question is, how would I even address this in a javascript that I didn' t even write and wouldn' t know how to begin to rework? Thanks in advance, if you get a chance to look and answer.[:j] And, did you say that all html tags should be lower case?
< Message edited by tterrifc -- 12/3/2002 5:53:12 PM >
_____________________________
Terry Ellis http://www.protectall.com http://www.protectallshineplus.com
|
|
|
|
tterrifc
Posts: 690 From: Riverside CA USA Status: offline
|
RE: Common HTML Validation Errors - 12/5/2002 14:38:09
I' m going to try to get pageoneresults to come by again and answer my questions by moving the topic up to the top again. P1R: More questions with regards to your tips. I have 10 errors left. 4 are related to javascripts (read previous post...above). I copied the following info from your site: quote:
The most important area to put on a diet is your <head> section. My clients probably have some of the leanest <head> sections out there. I use the title, description and keywords tags in that order along with an external style sheet reference, and that' s it! Some of the sites I manage do have rollover code in the head and I am slowly converting that to external .js (JavaScript) files. How do I do an external .js file? Is it just like a css? How do you call it out? And, what if .js is needed on a certain page only. Do you do separate file names? I' m sure you do, right? The other six say there are no attributes, " topmargin," " leftmargin," " rightmargin," " bottommargin," " marginheight," marginwidth." Would these need to be in a css file? I use all of them because I thought they were needed for NN and IE. Any advice you could give me would be appreciated. Here' s hoping you come by soon because you have me excited about making my pages valid. Thanks.
< Message edited by tterrifc -- 12/5/2002 2:40:47 PM >
_____________________________
Terry Ellis http://www.protectall.com http://www.protectallshineplus.com
|
|
|
|
abbeyvet
Posts: 5095 From: Kilkenny Ireland Status: offline
|
RE: Common HTML Validation Errors - 12/5/2002 14:44:20
Here is how to make an external .js file. If you have the same script in the head of several pages, just copy it into a text file (notepad), removing the opening and closing <script></script> tags in their entirity. Save this file in your root directory as, say, script.js Now replace the script in the head of your pages with a link to this .js file, thus: <script type=" text/javascript" src=" script.js" > That' s it. If the script has an event handler in the <body> tag, that still has to go in each page.
_____________________________
Katherine :: InKK Design :: InKK Domains
|
|
|
|
pageoneresults
Posts: 1001 From: Orange, CA USA Status: offline
|
RE: Common HTML Validation Errors - 12/5/2002 14:49:07
quote:
How do I do an external .js file? Is it just like a css? How do you call it out? And, what if .js is needed on a certain page only. Do you do separate file names? I' m sure you do, right? Open up Notepad, insert everything from your javascript including the opening and closing comments, like this... (leave out the javascript opening and closing tags) <!-- [Example code only. This is where your js goes] function newImage(arg) { if (document.images) { rslt = new Image(); rslt.src = arg; return rslt; } } // --> Save the file with a .js extension. What I normally do is make a sub-directory called javascript and stick any .js files in there. The path would look like this... /javascript/file.js Then, insert the js call into your <head></head> like this... <script type=" text/javascript" src=" http://www.domain.com/javascript/file.js" ></script>
I typically make the .js call the last thing in my <head> quote:
The other six say there are no attributes, " topmargin," " leftmargin," " rightmargin," " bottommargin," " marginheight," marginwidth." Would these need to be in a css file? I use all of them because I thought they were needed for NN and IE. Any advice you could give me would be appreciated. Those have to go. To control page margins in all browsers, insert this into your external css file... body{position:absolute;top:0px;left:0px;margin:0px;padding:0px;} You may have other attributes in your css body tag, just include the ones above and your margin issue will be solved. I' ve been swamped with building Orange County' s largest job site. Sorry about my lack of response, I' ll try to address that first error you posted with the div issue as soon as I can. Maybe someone else can assist while I' m busy keeping food on my table! ;)
< Message edited by pageoneresults -- 12/5/2002 2:58:14 PM >
_____________________________
SEO Consultants Directory Find Search Engine Marketing Companies
|
|
|
|
pageoneresults
Posts: 1001 From: Orange, CA USA Status: offline
|
RE: Common HTML Validation Errors - 12/5/2002 15:03:09
Your above <div> error will dissappear as soon as you offload the js into an external file. I' m not sure what that one is, I' ve never come across it since all my js is in external files. I' ll normally try to keep just one file for external javascript. If you have multiple files, they can be confusing at times and you may forget to update one that uses the same javascript you just updated in another. If you do use separate javascript files, try managing them within the sub-directories where they may apply. You can put them in your root folder as Katherine pointed out. I' m just too anal when it comes to my root, I don' t want anything but my primary pages in there along with a robots.txt file and any other mandatory root level files (mostly asp stuff).
_____________________________
SEO Consultants Directory Find Search Engine Marketing Companies
|
|
|
|
pageoneresults
Posts: 1001 From: Orange, CA USA Status: offline
|
RE: Common HTML Validation Errors - 12/5/2002 17:48:27
Congratulations Terry! You' ve just now crossed into the Twilight Zone. Don' t touch your dial, we' ve taken complete control over your television set! Glad that we could be of assistance. Do all of your pages validate? Or is it just the home page? Either way, you' ve now crossed over into a small percentage of the web that is using valid html/css. Again Congrats!
_____________________________
SEO Consultants Directory Find Search Engine Marketing Companies
|
|
|
|
Eli
Posts: 2658 From: ... er ... Status: offline
|
RE: Common HTML Validation Errors - 12/6/2002 4:27:49
I read somewhere that there is a FP plug in that is not only a validator but a program where you can reuse alot of scripts. Anyone heard of this?
|
|
|
|
pageoneresults
Posts: 1001 From: Orange, CA USA Status: offline
|
RE: Common HTML Validation Errors - 12/6/2002 13:16:52
Micah, if you do find something in regards to FP and a plug in for validation, please do let us know. I' m not aware of any as of yet. Also, on a quick note. Don' t be alarmed when you run your site through a validator and see that it has many errors. A good portion of those errors may relate to just one tag or attribute that is not correct. The reason I bring this up is I was just re-validating a page that originally validated. I inserted an affiliate URL which contains a string of characters that identify me as the affialiate. Within that string of characters are ampersands. It may have looked like this... https //www domain.com/sub/visitor.cgi?affiliate=00000&action=site&vendor=7000" > Those two ampersands caused I believe 8 errors on the page. As soon as I escaped them, the errors were gone. https //www regnow.com/sub/visitor.cgi?affiliate=00000& a m p ;action=site& a m p ;vendor=7000" > Note: No spaces between the & a m p ;. Had to do this to prevent parsing of the ampersand. Remove the spaces.
< Message edited by pageoneresults -- 12/6/2002 1:20:24 PM >
_____________________________
SEO Consultants Directory Find Search Engine Marketing Companies
|
|
|
|
pageoneresults
Posts: 1001 From: Orange, CA USA Status: offline
|
RE: Common HTML Validation Errors - 12/6/2002 18:19:32
Hmmm, I' d have to see the code and then see the error message from the validator. Height should be quoted " height" and your example shows ' height' . Please expand...
_____________________________
SEO Consultants Directory Find Search Engine Marketing Companies
|
|
|
|
pageoneresults
Posts: 1001 From: Orange, CA USA Status: offline
|
RE: Common HTML Validation Errors - 12/6/2002 18:55:24
I' ve never tried to validate using the strict dtd, I' ve always used the transitional which is more commonly used. Strict is just that, as a matter of fact, they should call it very strict!;) You have one error that can be cleared up in regards to javascript by replacing your opening javascript tags with the text/javascript attribute. The language attribute is now deprecated and won' t pass the validator... <script type=" text/javascript" > For external js tags, they should look like this... <script type=" text/javascript" src=" http //www domain.com/javascript/file.js" ></script> ...and no longer should they look like this... <script language=" javascript" src=" http //www domain.com/javascript/file.js" type=" text/javascript" ></script>
< Message edited by pageoneresults -- 12/6/2002 6:56:19 PM >
_____________________________
SEO Consultants Directory Find Search Engine Marketing Companies
|
|
|
|
pageoneresults
Posts: 1001 From: Orange, CA USA Status: offline
|
RE: Common HTML Validation Errors - 12/6/2002 18:57:45
On the alt issues, you should either specify an alt tag or put in an empty alt like this... alt=" " That' s two quotation marks side by side, no space inbetween.
_____________________________
SEO Consultants Directory Find Search Engine Marketing Companies
|
|
|
|
pageoneresults
Posts: 1001 From: Orange, CA USA Status: offline
|
RE: Common HTML Validation Errors - 12/6/2002 18:59:41
I always recommend that you not use heights on tables, they are not well supported and never have been. I' d strip out all height attributes on tables and cells. Typically they are not needed as your content will determine the height of the cell. If you have empty cells that you are attempting to assign a height to, it won' t work. It may look great in IE, but not in the other browsers.
_____________________________
SEO Consultants Directory Find Search Engine Marketing Companies
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|