Forum Moderators: open

Message Too Old, No Replies

HTML repair tool

         

linton

5:30 pm on Jan 14, 2004 (gmt 0)

10+ Year Member



Hi,
Newbie here - please bear with me. I have built my first website with approx 100 pages and most of it looks fine on my PC and those of my frineds in different countries. But when I checked my HTML code with a free HTML checker, it showed that I had about 200 HTML errors on my home page! Yikes!
Are there any free HTML repair tools out there that would help me to repair most of these errors?

asquithea

5:45 pm on Jan 14, 2004 (gmt 0)

10+ Year Member



A simple Find & Replace in your HTML editor is often the best solution.

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.

DrDoc

5:49 pm on Jan 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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.

choster

5:50 pm on Jan 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you looked at HTML Tidy (online [infohound.net] or local [sourceforge.net] versions available)? It basically reformats your source code, checking for things like mismatched or unclosed tags.

WeirdoPL

2:23 am on Jan 15, 2004 (gmt 0)

10+ Year Member



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! ;)

DrDoc

2:25 am on Jan 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Good job! Glad you got it to validate... and that you didn't give up! ;)

pendanticist

2:39 am on Jan 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Wasted! but Wiser!

linton

1:43 pm on Jan 16, 2004 (gmt 0)

10+ Year Member



Hi,
Thanks for all your suggestions. I have tried using HTML Tiday and W3 validator and see that it is changing my code to CSS format.
My question is - as I do not know anything about CSS, is it worthwhile doing some self-learning and re-writing my website using CSS?
Are there any disadvantages of using CSS? I am in the top 10 for a number of Google and Yahoo searches and wouldn't want to lose those positions?
Cheers,
Paul

robert adams

5:36 pm on Jan 16, 2004 (gmt 0)

10+ Year Member



check your pages in NS, IE and OPERA, if it works well, leave it alone.

no sense in taking a chance on messing up your seo.

robert

asquithea

6:22 pm on Jan 16, 2004 (gmt 0)

10+ Year Member



Using CSS is unlikely to harm your Search Engine rankings -- quite the opposite, most likely, since your content:presentation markup ratio will be higher.

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!

g1smd

9:59 pm on Jan 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



There are three places that CSS code can go.

-- 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.

Beach_lady

2:51 am on Feb 25, 2004 (gmt 0)

10+ Year Member



I just tried to validate my page with the W3C Markup Validation Service and I got this response.

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?

DrDoc

4:08 am on Feb 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What have I done wrong?

You have not specified a character encoding for the page... ;)
Here's an example of the most common character encoding (which will most likely work for your page as well):
<meta http-equiv="Content-type" content="text/html;charset=iso-8859-1">

Beach_lady

5:07 am on Feb 25, 2004 (gmt 0)

10+ Year Member



Thanks DrDoc for your help. Now it is saying I need a Doc tag. I am using angelfire with an upgrade for my website. I have no idea what to put there. I put one in but it says it is not HTML2.0. Any suggestions? For a year and a half I was coming up on all the search engines with my keywords. Since my listing disappeared, I have tried to correct my html mistakes and optomize my page. I thought I had all that finished but am still not showing up. Any help is greatly appreciated.

keyplyr

7:19 am on Feb 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Since it's been a while with no answer, let me suggest you try:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

This should be your first line in your mark-up (above <html>) Correct any errors to this DTD with the W3C html validator (link previously posted above)

HTML 4.01 Transitional will give you the most freedom while also being the most recent (and last) version of html.

Beach_lady

7:33 am on Feb 25, 2004 (gmt 0)

10+ Year Member



Thank you, I will try that. I don't understand a lot of this and am trying to learn as much as possible. Most of it is Greek to me. LOL.

Beach_lady

7:51 am on Feb 25, 2004 (gmt 0)

10+ Year Member



Thanks Keyplyr, I tried that and it said it was not valid HTML 4.01. How important is it to have a document tag? In looking at different pages, I see some have it and some don't. Will the search engines still spider the site without it?
Thanks

keyplyr

9:04 am on Feb 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




I tried that and it said it was not valid HTML 4.01

So fix the errors and it will be :)


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.

Beach_lady

1:36 pm on Feb 25, 2004 (gmt 0)

10+ Year Member



Thanks,
I will try that. Alot of what it says in the validator, I'm not sure I understand but will give it my best shot.

DrDoc

4:26 pm on Feb 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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 ;)

Beach_lady

4:27 pm on Feb 25, 2004 (gmt 0)

10+ Year Member



Hi again,
I am trying to correct all my errors and I get this error message:

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?

photon

6:04 pm on Feb 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



On the first error you'll need to use the format

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

If the script is in an external file, use the

src=
attribute. If not, then you can leave that bit out. The language part is not necessary and (I think) is now deprecated.

keyplyr

7:32 pm on Feb 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



  • As photon said, just change:

    <SCRIPT LANGUAGE="JavaScript">
    - to -
    <script type="text/javascript">

  • It looks to me that carriage returns, or other incorrect line-breaks have been used in your scripts. This causes unterminated string constants, in other words, a browser might stop reading the script because of those breaks. To correct this, make sure that the content between the single quotes is all on one line in your mark-up.

    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.

  • Beach_lady

    10:58 pm on Feb 25, 2004 (gmt 0)

    10+ Year Member



    The last error was not reported in W3C Validator but in CSE Validator. Now it shows one error.
    I can't find this last error. It is somewhere in this text. Can anyone figure this out?
    CAN ANYONE FIGURE THIS OUT?
    The error message is :

    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>

    Beach_lady

    10:59 pm on Feb 25, 2004 (gmt 0)

    10+ Year Member



    This last error is in W3C Validator.

    keyplyr

    12:46 am on Feb 26, 2004 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



    One way to "fix" it so the page validates, is to move the entire script to it's own file and call it externally. To do this, just create a .txt file using any text editor containing the code between:

    <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.

    Beach_lady

    2:55 am on Feb 26, 2004 (gmt 0)

    10+ Year Member



    Hi Keyplyr,
    I guess I'm not understanding. 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? I'm pretty illiterate where all this is concerned. I like the way the two scripts look on the page and feel they add a lot but if they are going to keep the page from validating, then I guess I will have to remove them. I only posted one of the scripts above. I figured if I could get that one straight then I would probably be able to do the other one. I see lots of top pages pages with html mistakes and they still get ranked well.
    Thanks again

    keyplyr

    4:26 am on Feb 26, 2004 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



    I make a text file (on my host server?) like I did with the robot.txt?

    Yes, then rename it "whatever.js"

    Then I put the script in place in the Heading? Don't I put anything in the body where the original code was?

    Sorry, I assumed it was for the HEAD section. Put the link in the body; the same place where the code had been.

    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 :)

    Beach_lady

    5:45 am on Feb 26, 2004 (gmt 0)

    10+ Year Member



    Hi again, I tried it but it would not work. Oh well, I just added the text without the effect.
    Thanks anyway. The page did validate and is now submitted. Cross your fingures that I will appear back in the listings.

    keyplyr

    8:29 am on Feb 26, 2004 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



    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:

  • It had errors, thus causing your page not to validate.

  • Removing it pushes your keywords/keyphrases higher in the mark-up giving greater relavancy and increasing the percentage of search querry matches.

  • "Effects" are hard to let go of, but ultimately a waste of bandwidth since, by definition, they usually do not increase the value of the page or the ROI.

  • "Effects" usually cause code bloat and slow page load.

  • Some users find then tacky.
  • This 34 message thread spans 2 pages: 34