Forum Moderators: open

Message Too Old, No Replies

<body> tag

how important is it?

         

Sinner_G

2:08 pm on Aug 8, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a site on which I would like to omit the <body> tag for different reasons. A test page with just a table and a link to a css file seems to work quite well. Am I missing something?

The table is set at 100% so I can set the background for the page there. So is there really a point to that tag or is it just for code structure?

Nick_W

2:13 pm on Aug 8, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Code structure and point.

The body tag tells a broser where the actuall document content is. On some browsers, leaving it out woun't work.

Why do you need to leave it out, I had a quick thing and can't come up with a single scenario where that would be needed?

Nick

Sinner_G

2:16 pm on Aug 8, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Free host service uses it to put its own code into my page, which opens a popup window. would like to see if it's possible to avoid that ;).

Woz

2:19 pm on Aug 8, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Change host sinner. There are plenty out there that offer good service without banners etc. Or pay for a cheap host. Hostica comes to mind.

Onya
Woz

Sinner_G

2:23 pm on Aug 8, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Change Host.

Could do that, but it is a challenge somehow. I just want to know if it would be possible to get around that.

diddlydazz

2:43 pm on Aug 8, 2002 (gmt 0)

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



hi sinner,

leaving out the body tag could (and probably will) cause some serious rendering errors in *most* browsers, not to mention spiders.

As suggested look around for a different host, there *are* some out there that don't interfere with your page too much if at all.

But I wouldn't see ommitting the body tag as a viable option.

Good Luck

Dazz

Knowles

2:47 pm on Aug 8, 2002 (gmt 0)

10+ Year Member



Can you use server side scripting? Possibly try dynamically writting in the body tag to see that will circumvent the host from inserting the code.

Have you tried loading with out the body tag? After a few times did it not auto insert the tag?

idiotgirl

2:52 pm on Aug 8, 2002 (gmt 0)

10+ Year Member Top Contributors Of The Month



Free host service uses it to put its own code into my page

Just a word of caution sinner_g - any free host I've ever come across requires that, in exchange for their free hosting, you allow them to inject whatever scripting they choose into your pages. It's part of their TOS. Some offer alternatives to popups, but it depends on the host.

Sinner_G

2:56 pm on Aug 8, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I know, idiotgirl, and I think I will stop messing with it as soon as I know how I COULD do it.

Guess it's more curiosity/challenge than anything else.

moonbiter

3:08 pm on Aug 8, 2002 (gmt 0)

10+ Year Member



You could do it using javascript document.write(), I think. Or on modern browsers, document.createElement('body'). But that would be a pain to maintain.

I agree with the others, change hosts.

Sinner_G

3:29 pm on Aug 8, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Great idea moonbiter, the document.write does the job (tested with IE6, NS 4.7 and NS 7 Preview). Thanks.

rewboss

9:36 am on Aug 9, 2002 (gmt 0)

10+ Year Member



Never use pop-up busting devices on web hosts that require you to display pop-ups. In doing so, you are in breach of your contract (yes, you do have a contract with them), and as soon as they discover what you are doing, they will terminate your account without warning, and in all likelihood you will not be able to reinstate it.

Many free hosts have "search-and-destroy" bots that crawl member pages looking for exactly this sort of dodge. They are often very efficient.

dhdweb

6:23 pm on Aug 13, 2002 (gmt 0)

10+ Year Member



Get a real host, its cheaper than you think!

mbauser2

7:51 pm on Aug 13, 2002 (gmt 0)

10+ Year Member



The body tag tells a broser where the actuall document content is. On some browsers, leaving it out woun't work.

Name one browser that does that, and I'll name a browser that's severely broken.

From the HTML 4.0 DTD [w3.org]:

<!ELEMENT BODY O O (%block;¦SCRIPT)+ +(INS¦DEL) -- document body -->

The double O's after the word "BODY" mean the start and end tags are optional [w3.org]. BODY is a "required and implied" element -- browsers have to assume it exists whenever they see BODY-only content.

[edited by: mbauser2 at 8:27 pm (utc) on Aug. 13, 2002]

richlowe

7:57 pm on Aug 13, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



and as soon as they discover what you are doing, they will terminate your account without warning, and in all likelihood you will not be able to reinstate it.

As far as free hosts go, by terminating your account they will be doing you a favor. There is no longer, in my opinion, such a thing as a good (or even mediocre) free host.

The "good old days" of geocities in the late 90s are long gone.

Richard Lowe