Forum Moderators: open

Message Too Old, No Replies

Seach Engines and Body Tags

Should I remove all my onLoads?

         

Vix332

12:12 am on Jun 14, 2003 (gmt 0)



and is it necessary for search engines? I have been reading a lot on the best way to write pages for search engines and it appears that a clean body tag is important mine had quite a lot in it
----------
<body bgcolor="#CCFFFF" topmargin="0" onLoad="MM_preloadImages
('../images/navbar/navBar_r1_c1_f3.gif',
'../images/navbar/navBar_r1_c1_f2.gif',
'../images/navbar/navBar_r3_c2_f3.gif',
'../images/navbar/navBar_r3_c2_f2.gif',
'../images/navbar/navBar_r5_c2_f3.gif',
'../images/navbar/navBar_r5_c2_f2.gif',
'../images/navbar/navBar_r7_c2_f3.gif',
'../images/navbar/navBar_r7_c2_f2.gif',
'../images/navbar/navBar_r9_c1_f3.gif',
'../images/navbar/navBar_r9_c1_f2.gif',
'../images/navbar/navBar_r11_c2_f3.gif',
'../images/navbar/navBar_r11_c2_f2.gif')
">
---------
and I would like to ask if there is a way of taking it our using css or is it not that important?
Thanks in advance
Vix

[edited by: pageoneresults at 3:23 pm (utc) on June 14, 2003]
[edit reason] Reformatted to prevent scrolling. [/edit]

pageoneresults

3:34 pm on Jun 14, 2003 (gmt 0)

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



Hello Vix332, Welcome to WebmasterWorld [webmasterworld.com]!

I'll be happy to offer some advice.

First thing I would do is create an external .js (javascript) file.

/scripts/rollover.js

Then I would move all of the preload script into that external file. I would then place an external .js call in the <head></head> of my document...

<head>
<title>
<description>
<keywords>
<link href="/css/styles.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="/scripts/rollover.js"></script>
</head>

The next thing to do is to move the bgcolor and topmargin attributes into an external CSS file...

/css/styles.css

And call the external file through your <head></head> as shown above. The CSS might look like this...

body{top:0;left:0;margin:0;padding:0;color:#000;background:#cff;}

That will leave you with this for your <body> tag...

<body onLoad="MM_preloadImages">

The advantages here have to do with site maintenance and html code bloat. The goal is to move as much presentational markup and javascript to external files so that you can trim the html to text ratio.

P.S. It looks like you are using DW for development. I believe DW has an option to save javascript to an external file. There will be more in that external .js file than the img calls that were in the body tag. There will be other code to preload the images and there is also probably a fix for the NN4.x resize issue.