Forum Moderators: open
Your page probably has only a few different types of error -- just repeated lots of times; all you need to do is find the first instance of each, realise your mistake, and do a Find and Replace for all other versions of the same error. Sometimes a single page error can ripple though an entire page of markup, so when you fix the first one, all the rest vanish.
You'll probably need an editor that is capable of processing all pages in a project. I use HAPEdit for this purpose, but you may well be able to find a better one.
The best thing about doing it by hand, rather than relying on a tool, is that you'll learn not to make the same mistake again ;-) -- which will save you time in the long run.
The best thing about doing it by hand, rather than relying on a tool, is that you'll learn not to make the same mistake again ;-) -- which will save you time in the long run.
Well said!
When validating your page, always use the official validator found at [validator.w3.org...]
Then start with the first error listed, fix it, revalidate, fix the next error, revalidate... etc.
It is probably a good idea to only make one page before validating. That way you only have to fix one document, and all other pages will be based on that one. Also, don't forget to test your page is as many browsers as possible.
When validating your page, always use the official validator found at [validator.w3.org<...]
Thank You Dr Doc!After aproximately one hour of validating my small (2kB) page I really got the feeling of being at least a half-god of HTML, when it finally passed.
Oh yeah! I'm the best! Wasted! ;)
Learning CSS, however, requires a significant investment of time and effort. It's something of a frustrating experience, because CSS 2 in Internet Explorer recalls the days of 3.x browsers, where even a simple <font> tag was unreliable. You'll also find that you can't always recreate your precise table layouts in CSS -- it's a more fluid presentation mechanism that favours reflowing content over rigid image grids.
The benefits of at least knowing how to use CSS are considerable. You'll find your knowledge of the W3C HTML specs improves, and your sites will take on a more modern look and feel. You might begin to leave users of Netscape 4 behind, but users with newer browsers can take advantage of extra features, such as the ability to radically change the look of your site on the fly. A new look to a site can pull in old customers, too, since it gives the site a feeling of being maintained. You'll find it much easier to maintain an accessible site for partially sighted users, perhaps offering a high-contrast version of your content (very hard in HTML 3.2) with a simple change of stylesheet. Your site should load faster too, since you won't be covering your pages with reams of extra markup.
I feel that the benefits of CSS do outweigh the drawbacks, but might find you'll need to change your design philosophy a little to accomodate the change. If you're planning to adopt valid HTML as a preference, you're probably mentally flexible enough to accept the idea of CSS. Go for it!
-- inline style on HTML tags. This leads to massive code bloat and should be avoided. It is also very difficult to update your site as many entries have to be changed in each page.
-- as a stylesheet in the <head> section of the document. This collects the CSS all into one place on the page, but when you want to update your site, you have to make a change in every page of the site.
-- as an external style sheet in a .css file that every page of the site links to. This makes your site much faster to access as the file is served once per visitor, rather than being embedded inside every page. When you want to update your site layout, then there is one change in just one file to do the whole site all at once.
was not able to extract a character encoding labeling from any of the valid sources for such information. Without encoding information it is impossible to validate the document. The sources I tried are:
The HTTP Content-Type field.
The XML Declaration.
The HTML "META" element.
What have I done wrong?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
HTML 4.01 Transitional will give you the most freedom while also being the most recent (and last) version of html.
I tried that and it said it was not valid HTML 4.01
How important is it to have a document tag?
A document tag's (DTD) purpose is to tell the browser what version of code is being used, so the browser will render accordingly - otherwise the browser has to guess. As a webmaster, you really do not want to surrender this level of control do you?
In looking at different pages, I see some have it and some don't. Will the search engines still spider the site without it?
Yes, SE robots will still crawl the site - however, just one fatal error could possibly affect the crawl, you will never really know unless you validate.
Just start with one page. Install the DTD, validate and fix the errors. You will learn allot. The remaining pages will become easier since you will learn what to look for. After you're done and your entire site is error-free and it validates, you will experience a wonderful feeling! Most of us here have gone through it at some point. Seems like a lot of work, but it's really worth it.
How important is it to have a document tag? ... Will the search engines still spider the site without it?
keyplyr is absolutely right -- one tiny little error can render your page impossble to spider. A page that validates is more likely to be liked by spiders and easy to crawl. However, the spider doesn't use the doctype per se. But it is still useful to have it there since the browser uses it ;)
HTML 4.01 and XHTML require the "type" attribute to specify the scripting language for the "SCRIPT" element. For example, use type="text/javascript" for JavaScript. Note that some browsers may work without this attribute but it is highly recommended that it be used.
This is what it is referring to:<SCRIPT LANGUAGE="JavaScript">
I don't know how to edit this. This is part of a script that is shareware. When I tried what I thought it meant, it no longer worked on the page.
Also I get this error message about quotes:
This line contains part of a quoted string that spans more than one line (not recommended) or a quoted string (like an attribute value) that is missing the start or end quotation mark. You should check this line for improperly quoted attribute values that may be missing a start or end quotation mark. As currently configured, HTML Validator requires that all quoted strings be contained on one line and have start and end quotation marks. Note that because of inconsistent handling by user agents, it is not recommended that attribute values contain line breaks.
How do I fix this or can this be ignored?
<SCRIPT LANGUAGE="JavaScript">
- to -
<script type="text/javascript">
You will also find that validators cascade the errors. So if you fix the first error, other reported errors beneath will often be corrected also.
end tag for element "SPAN" which is not open
This is the code that the error is on.
<FONT COLOR="#ff0033"><span id="fly"></span></FONT>
<script type="text/javascript">
window.onerror=new Function("return true")
//Flying Letters script- (I took out the name for this forum)
//Configure message to display. Use "$" for linebreak
message = "widget $widget! $widget $widget" // $ = taking a new line
distance = 250 // pixel(s)
speed = 100 // milliseconds
if (!document.all)
document.write('+message+')
</script>
<script type="text/javascript1.2">
txt="";num=0;num4=0;flyofle="";flyofwi="";flyofto=""
function stfly(){for(i=0;i!= message.length;i++){if(message.charAt(i)!= "$"){txt=txt+"<span style='position:relative;visibility:hidden;' id='n"+i+"'>"+message.charAt(i)+"</span>"};else{txt=txt+"<br>"}};fly.innerHTML=txt;txt="";flyofle=fly.offsetLeft;flyofwi=fly.offsetWidth;flyofto=fly.offsetTop;fly2b()}
function fly2b(){if(num4!= message.length){if(message.charAt(num4)!= "$"){eval("n"+num4+".style.left=flyofle-n"+num4+".offsetLeft+flyofwi/2");eval("n"+num4+".style.top=flyofto-n"+num4+".offsetTop+distance");eval("fly3('n"+num4+"',eval(n"+num4+".style.left.substring(0,n"+num4+".style.left.length-2)),(eval(n"+num4+".style.left.substring(0,n"+num4+".style.left.length-2))/5),eval(n"+num4+".style.top.substring(0,n"+num4+".style.top.length-2)),(eval(n"+num4+".style.top.substring(0,n"+num4+".style.top.length-2))/5))")};num4++;setTimeout("fly2b()",speed)}}
function fly3(target,lef2,num2,top2,num3){if((Math.floor(top2)!= 0 && Math.floor(top2)!= -1) ¦¦ (Math.floor(lef2)!= 0 && Math.floor(lef2)!= -1)){if(eval("'"+lef2+"'").charAt(0)!= '-'){lef2=lef2-num2};else{lef2=lef2+(-num2)};if(Math.floor(lef2)!= -1){eval(target+".style.visibility='visible';"+target+".style.left=Math.floor(lef2)")};else{eval(target+".style.visibility='visible';"+target+".style.left=Math.floor(lef2+1)")};if(eval("'"+lef2+"'").charAt(0)!= '-'){top2=top2-num3};else{top2=top2+(-num3)};if(Math.floor(top2)!= -1){eval(target+".style.top=Math.floor(top2)")};else{eval(target+".style.top=Math.floor(top2+1)")};setTimeout("fly3('"+target+"',"+lef2+","+num2+","+top2+","+num3+")",50)}};
stfly()
</script>
<script type="text/javascript1.2">
and
</script>.
(These tags can be left out of the .js file)
Rename it "whatever.js"
Then from the HEAD section of your page mark-up, call the script like this:
<script type="text/javascript" src="/whatever.js"></script>
This really doesn't correct anything, but it will enable you to move on with finding any other errors on the page. And I would only use the W3c Validator.
I make a text file (on my host server?) like I did with the robot.txt?
Then I put the script in place in the Heading? Don't I put anything in the body where the original code was?
You can do this for all scripts. If any of these scripts are used on other pages, this will actually speed up those pages loading since this script will already be in the browser's cache.
Also, many webmasters like to keep external scripts in their own directory, especially if there are several. Then your path might look like this:
<script type="text/javascript" src="/scripts/whatever.js"></script>
<added>
Don't forget to make a back-up copy of files you are working on... just in case :)
Oh well, I just added the text without the effect.
Sorry - but actually you may be better off not having all that JS in your mark-up for several reasons: