Forum Moderators: open

Message Too Old, No Replies

Just how Valid do you have to be?

Somebody give me a Sign

         

Propools

5:13 pm on Mar 24, 2008 (gmt 0)

10+ Year Member



So in architecting the page, just how HTML valid does the page have to be, before it's not scored well by the SE's?

I've been using validator.w3c.org as a tool and sometimes my dreamweaver tool, but what tools do you use?

Oh, yeah, to what extent is the order in which you put data in the head of the doc important?

Is:

<!DOCTYPE
<html>
<head>
<title>
<meta name="Description" (etc.....)
<meta name="Keywords" (etc.....)
<meta name="verify-v1" (etc.....)
<meta http-equiv="Content-Type" (etc.....)
<meta name="y_key" (etc.....)
<style type="text/css"> (etc.....)
<body>

Better than:
<html>
<head>
<title>
<script src="/scripts/
<script src="/scripts/
<script src="/scripts/
<link rel="stylesheet" href="/scripts/
<link rel="stylesheet" href="/scripts/
<link rel="stylesheet" href="/scripts/
<meta name="keywords"
<meta name="description"
<body>

-OR- does it really not matter to the SE's when it comes to a pages validity, score, postion in SERP's, etc.?

[edited by: jatar_k at 6:16 pm (utc) on Mar. 24, 2008]
[edit reason] fixed formatting [/edit]

g1smd

6:02 pm on Mar 24, 2008 (gmt 0)

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



First: Content-Type Encoding and Language.

Second: Title and Meta Description.

Next: Links to Stylesheets and Scripts.

Last: Other Stuff like Google and Yahoo tags (except I prefer to use the HTML file for that).

Propools

7:06 pm on Mar 24, 2008 (gmt 0)

10+ Year Member



Cool Beans. Thanks A Lot. :)

Fotiman

7:21 pm on Mar 24, 2008 (gmt 0)

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



First: Content-Type Encoding and Language and meta tags

Second: Stylesheets (want these as close to the top as possible, but after content type)

Next: Title

Next: Body

Last: Just before closing </body>, put all your scripts. This gives the best performance.

lavazza

10:27 pm on Mar 24, 2008 (gmt 0)

10+ Year Member



@Fotiman,

I guess you don't mean links to scripts... as in:

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

Either way... one Q:
Why/how does your tip give "the best performance"?

g1smd

11:18 pm on Mar 24, 2008 (gmt 0)

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



Ah yes, links to external scripts (like analytics and tracking stuff) is best done far down the page, after the content, so that failure to load those scripts does not impair the display of your content.

In my original answer I only addressed stuff that is wholly within your own site.

Trace

1:25 pm on Mar 25, 2008 (gmt 0)

10+ Year Member



I've always thought it was "best practice" to have all your scripts, inline and external, located right before the </body>.

A couple of reasons pop into mind right away;
1- like mentioned right above, it won't lag the load of content
2- Any script that affects elements in page won't break trying to affect an element that hasn't been rendered yet.

Would there be an advantage to having the scripts somewhere else, like in the good old days in the <head> portion of a page?

Fotiman

3:18 pm on Mar 25, 2008 (gmt 0)

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



@lavazza
Yes, I do mean links to scripts. Ideally, you should not have any actual scripts within your HTML document, but rather they should be linked in. And they should be located as far down as the document for reasons mentioned above.

The loading of a script file will "block" the loading of any content below it. So putting scripts up in the <head> means that the browser will not load any of the content until it finishes loading all of the scripts, which can give quite a delay before the user sees any content.

Fotiman

3:22 pm on Mar 25, 2008 (gmt 0)

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



Some recommended viewing:
Douglas Crockford's "Theory of the DOM" (search for it on video.yahoo.com)