could a page function properly without <body> and <

  • pine_things
  • Novice
  • Novice
  • No Avatar
  • Joined: Jun 05, 2005
  • Posts: 20
  • Loc: Warwickshire, UK
  • Status: Offline

Post September 11th, 2005, 1:34 am

My main page of the wubsite is a combination of html and asp pages.

I am trying to install statcounter on my pages, and they tell me that in order for it to work, I need to "correct my pages" in order to show <body> and </body>.

Their answers in red, my answers in green. Could I have your opinion please?


Your pages are not being rendered correctly as html.

Whatever the problem is with whatever method you're using, there's no <body> and no </body>. These are required elements of html. In order to see a page on the web, asp and all other languages must render correct html code. Yes, IE and maybe other browsers still work to some extent with totally incorrect syntax and structure. But adding extra code makes them crumble - in differnet ways depending on browser.


my first page is a combination of 2 pages default.asp and default.html

all the pages are view correctly by any browser and also individually indexed by search engines.

are you saying that i need the syntax <body> and </body> in order for the stacounter to work?

if it is a lot of work to change it, is there any other way to get the statcounter to work?


Sorry, you need <body> and </body> - basically all correct html syntax - all the time, regardless of using or not Statcounter.

You are lucky that so far IE seems to render your page OK. It operates in quirks mode. Unpredictable. So will other browsers. They guess what should be there and make allowances which so far have been clement to yoru page.

When you start adding scripts however the game becomes trickier. Browser behaviour becomes more unpredictable.

Inclusion of the Statcounter code was just the straw that broke the camel's back. It could have happened with any other scripts.

The only solution is to fix your asp code so that correct html is output at all times.


Starting with version 4 for IE and version 6 of Netscape, you do not need to have <body> and </body> in order to allow the users to open more than one windows in a browser. All the events type body_onload, body_onclick are replaced by window_onload, window_onclick so you do not need to write the function for each page.

If the browsers did not display the pages properly, how do you explain that all pages are indexed properly?


Browsers simply guess and make a lot of allowances. Not all of them guess the same way either. Don't rely on it, please, if you want to avoid the weirdest problems now or later.

Getting indexed is not the main thing a page has to be fit for.

But if you don't believe me, that's fine. Ask elsewhere and see what you find out. I've said all I can about it.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post September 11th, 2005, 1:34 am

Post September 11th, 2005, 1:52 am

Well, technically, your pages need body tags, but in reality, most browsers will render it without them (this doesn't mean it's ok to leave them out)

You don't mention who "they" are, or how their counter code is supposed to be included. Please provide more details.
  • pine_things
  • Novice
  • Novice
  • No Avatar
  • Joined: Jun 05, 2005
  • Posts: 20
  • Loc: Warwickshire, UK
  • Status: Offline

Post September 11th, 2005, 1:58 am

THEY=statcounter.com

their script should be included between <body> and</body>

Post September 11th, 2005, 2:04 am

so what's the problem? Add <body> tags to your pages.
  • pine_things
  • Novice
  • Novice
  • No Avatar
  • Joined: Jun 05, 2005
  • Posts: 20
  • Loc: Warwickshire, UK
  • Status: Offline

Post September 11th, 2005, 9:16 am

my pages will not work if i add those tags.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 22772
  • Loc: Pittsburgh PA
  • Status: Online

Post September 11th, 2005, 9:19 am

pine_things wrote:
my pages will not work if i add those tags.

*huh? They have to work. If they don't you're either adding them in the wrong place, or using them improperly in the code.
"There's no place like 127.0.0.1 except for ::1."
Play sports pools and discuss sports topics at Boasting Rights Sports Forum
Get paid to write articles - www.associatedcontent.com
  • Zwirko
  • Guru
  • Guru
  • User avatar
  • Joined: May 29, 2005
  • Posts: 1404
  • Loc: 55° N, 3° W
  • Status: Offline

Post September 11th, 2005, 12:04 pm

Your site:

..... </head>
<body>
<div align="center">
<center>
<table cellspacing=0 cellpadding=0 .....




..... </tr>
</table>
</center>
</div>

</body>
</html>


Add the orange bits where I have. That may not even be your problem.
But your pages are not proper web pages without them.
  • pine_things
  • Novice
  • Novice
  • No Avatar
  • Joined: Jun 05, 2005
  • Posts: 20
  • Loc: Warwickshire, UK
  • Status: Offline

Post September 11th, 2005, 1:30 pm

i guess you are looking at the view source source code of the main page....

but the main page is made out of 4 pages:
-default.html
-default.asp
-header.html
-footer.html

in fact the majority of pages are made out of a combination of pages.

so when the page shows, it is a result of all those.

if you want me to change the code, on which page do you suggst to change it?
  • Zwirko
  • Guru
  • Guru
  • User avatar
  • Joined: May 29, 2005
  • Posts: 1404
  • Loc: 55° N, 3° W
  • Status: Offline

Post September 11th, 2005, 2:22 pm

Well, that has to be one of the wierdest web pages I have seen in a
while.

Every page should have <html>,<head> and <body> regardless.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 22772
  • Loc: Pittsburgh PA
  • Status: Online

Post September 11th, 2005, 2:37 pm

Like I said, look at how you're including the body tags in one (or more) of your include pages.
"There's no place like 127.0.0.1 except for ::1."
Play sports pools and discuss sports topics at Boasting Rights Sports Forum
Get paid to write articles - www.associatedcontent.com
  • pine_things
  • Novice
  • Novice
  • No Avatar
  • Joined: Jun 05, 2005
  • Posts: 20
  • Loc: Warwickshire, UK
  • Status: Offline

Post September 11th, 2005, 2:37 pm

SugarKane wrote:
Well, that has to be one of the wierdest web pages I have seen in a while


Do you mean it is so advanced that it is difficult to understand?? :idea:
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 22772
  • Loc: Pittsburgh PA
  • Status: Online

Post September 11th, 2005, 2:40 pm

The problem is most likely that statcounter requires the body tag in the include page you are trying to include their code. Apparently you have the body tags already in use, so yes, you can't include them. But if statcounter requires them, then you are going to have to adjust for which page you are including their code to match the one that does include the body tags.
"There's no place like 127.0.0.1 except for ::1."
Play sports pools and discuss sports topics at Boasting Rights Sports Forum
Get paid to write articles - www.associatedcontent.com

Post Information

  • Total Posts in this topic: 12 posts
  • Users browsing this forum: No registered users and 101 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2010 Unmelted, LLC. Driven by phpBB © 2010 phpBB Group.