Fixing Yahoo Webhosting Validation Problem

Recently, I was attempting to validate a page for a client’s web site using the HTML Validation Tool and had some interesting and unexpected results. The document failed validation which was strange since I routinely make it a point to double check all of my markup before even uploading the page to the testing server. Determined to get to the bottom of this, I diligently went about inspecting the results and noticed something very peculiar. The errors were the result of HTML that I didn’t put on the page. “How can this be?” I wondered. “Where did this come from?”

It turns out that the code was inserted by Yahoo in order to track site statistics, which I suppose is okay – kind of. There are two major problems with this, the first being the code is inserted after the

tag and the other is it isn’t even valid markup. Now, this is the appropriate time for a disclaimer to mitigate the number of people ready to jump on me. Normally I would not use Yahoo’s Webhosting. However, based on past experience I have found their Small Business Merchant Solution makes building an e-commerce site a cost-effective solution for the client and makes updates to the product database very simple.

Getting back to the issue at hand, after a little digging around on the Yahoo help documents I was able to come up with the following solution that will block Yahoo from amending the markup and allow the site to validate.

First, lets start by taking a look at the original markup:

geovisit();

The first step to fixing the problem is to turn off site statistics by doing the following:

1. Sign in to your Web Hosting plan.

2. On the Home tab, in the Site Activity module, click the “Site Statistics” link.

3. Click the “Options” link in the upper-right corner of the Site Statistics page.

4. Toward the bottom of the page, select the radio button accompanying “Do not collect statistical data for my site (turn off site statistics).”

5. Click the “Save” button.

This will stop Yahoo from adding this code to your webpages.

Next, we need to take a look at the tracking code and fix the errors. The first error is the “language=’JavaScript'” attribute which is depreciated and no longer used. It has been replaced with the “type=’text/JavaScript'” attribute. The second error is in the SRC attribute for the image, it’s simply the unencoded “&” which should be “&”. So with that taken care of here’s the updated code block:

geovisit();

Simply insert the above code into the

tags of all your web sites pages and violla and if the rest of your markup is correct the page will validate.

Of course, an even simpler and perhaps better solution would be to simply find another hosting company. But, like I mentioned earlier, in the case of a small to medium e-commerce site Yahoo really is perhaps the most viable option. I would be remiss if I didn’t add that I am really dissapointed in Yahoo though. If they are going to be inserting their own code into other peoples HTML, they should at least make sure it is valid and placed in the proper location. Coming up in a future post I’ll be showing how to validate HTML which contains Flash, since the Macromedia markup used thoughout the web is abysmal and not even close to being valid HTML.

Discover how to go about choosing a Top Web Hosting Providers, to get information about Host Gator Web Hosting Review you must read Web Hosting Reviews And Ratings here.

About the Author

Leave a Reply