PDA

View Full Version : Do I need a doctype on this page?


Ben@WEBProp
07-11-2003, 05:48 PM
I have a page that consits of a small amount of text, a few tags, and a Java applet that takes up about 90% of the coding. I put a doctype into all of the pages on my site, but if I do understand what a doctype does correctly, then it will do no good in the case of this page. In fact, I'm sure that in some browsers, it will only distort my page. Should I get rid of the doctype? If I do, will W3C hack my computer and sadisticly flood my computer with death-text and brazen system errors?

-Ben

Spookster
07-11-2003, 06:34 PM
Originally posted by Ben@WEBProp
Should I get rid of the doctype?

No.


Originally posted by Ben@WEBProp
will W3C hack my computer and sadisticly flood my computer with death-text and brazen system errors?

Yes


Any more questions? :)


But seriously the doctype tells the browser what set of guidelines to follow and if you are using XHTML then you will probably want the browser to know that so it will know how to deal with XHTML tags such as ones that don't have ending tags.

You should always use a doctype even if it may not affect how the page gets rendered even if just to get into the habit of it.

Ben@WEBProp
07-11-2003, 06:48 PM
Alright, so I should at least keep a Doctype in, but what one should I use? Does Java fall under the category of XML? Here is my source code thus far on the page...what doctype do you recommend?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>::-::-::-Welcome to WEB Properties, Inc.com!-::-::-::</title>
<script language="JavaScript" fptype="dynamicanimation">
<!--
function dynAnimation() {}
function clickSwapImg() {}
//-->
</script>
<script language="JavaScript1.2" fptype="dynamicanimation" src="animate.js">
</script>
<base target="_self">
<script language="javascript" type="text/javascript" src="framer.js">
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" vlink="#0000FF" alink="#0000FF" onload="dynAnimation()">
<table width=100% height=90% bordercolor="#000000" bordercolordark="#000000" bordercolorlight="#000000">
<tr>
<td align=center valign=center height="7.24%">
<p dynamicanimation="fpAnimelasticRightFP1" id="fpAnimelasticRightFP1" style="position: relative !important; visibility: hidden" language="Javascript1.2" align="left"><font face="Verdana" size="4"><b>
Welcome to WEB Properties, Inc.com!</b></font></p>
</td>
</tr>
<tr>
<td align=center valign=center height="7.24%">&nbsp;
</td>
</tr>
<tr>
<td align=center valign=center height="7%">&nbsp;
</td>
</tr>
<tr>
<td align=center valign=center height="7%">&nbsp;
<h1 align="left"></h1>
</td>
</tr>
<tr>
<td align=center valign=center height="54%">
<applet archive="TmapCube.jar" code="TmapCube.class" width="188" height="188">
<param name="credits" value="Applet by Fabio Ciucci (www.anfyteam.com)">
<param name="res" value="1">
<param name="image1" value="images/cubelogo.gif">
<param name="image2" value="images/cubelogo.gif">
<param name="image3" value="images/cubelogo.gif">
<param name="image4" value="images/cubelogo.gif">
<param name="image5" value="images/cubelogo.gif">
<param name="image6" value="images/cubelogo.gif">
<param name="interactive" value="YES">
<param name="lightsourced" value="NO">
<param name="lightpower" value="100">
<param name="lightmin" value="150">
<param name="lightmax" value="400">
<param name="rotx" value="2">
<param name="roty" value="3">
<param name="rotz" value="4">
<param name="backimage" value="images/jsbg.jpg">
<param name="backr" value="255">
<param name="backg" value="255">
<param name="backb" value="255">
<param name="clearback" value="YES">
<param name="overimg" value="NO">
<param name="overimgX" value="140">
<param name="overimgY" value="150">
<param name="textscroll" value="tcubescr.txt">
<param name="texttype" value="horizontal">
<param name="textvspace" value="0">
<param name="textminfont" value="8">
<param name="textmaxfont" value="172">
<param name="textoffset" value="1">
<param name="textspeed" value="1">
<param name="textfont" value="TimesRoman">
<param name="textbold" value="NO">
<param name="textitalic" value="NO">
<param name="textsize" value="14">
<param name="textshadow" value="YES">
<param name="TextSColR" value="20">
<param name="TextSColG" value="20">
<param name="TextSColB" value="50">
<param name="TextColR" value="255">
<param name="TextColG" value="235">
<param name="TextColB" value="100">
<param name="TextJumpAmp" value="0">
<param name="TextJumpSpd" value="0">
<param name="TextSineAmp" value="0">
<param name="TextSineSpd" value="0">
<param name="TextSineAngle" value="0">
<param name="regcode" value="NO">
<param name="reglink" value="NO">
<param name="regnewframe" value="NO">
<param name="regframename" value="_blank">
<param name="statusmsg" value="Tmapcube applet">
<param name="memdelay" value="1000">
<param name="priority" value="3">
<param name="priorityL" value="3">
<param name="MinSYNC" value="10">
Sorry, your browser doesn't support Java(tm).
</applet>
</td>
</tr>
<tr>
<td align=center valign=center height="16.54%">
</td>
</tr>
</table>
<p>&nbsp;</p>
</body>
</html>

Thanks!

-Ben

oracleguy
07-11-2003, 07:07 PM
I think even in HTML 4.01 you need to have quote around attribute values. I see that some of yours don't.

You probably just want to keep using 4.01 unless you are going to make the required changes. Because that page is closest to 4.01.

Ben@WEBProp
07-11-2003, 07:19 PM
So let me ask you this, then:

The applet calls for several outside files. Is it plausible for me to copy all of the applet information into an external file so that all the page is left with is HTML with ony one or two lines calling for external files? If I could do that, what portion exactly would I copy into a text file, and what would be the extension that I would use for calling that file? (ie- Cube.class? Cube.js? Cube.txt? Cube.dll?)

Thanks

-Ben

oracleguy
07-11-2003, 07:22 PM
I don't really see a reason to copy the applet information out of the page. The only method I know of is a server side include which wouldn't make any difference, unless you want to use the applet on several pages.


(1000th post.:cool: )

Ben@WEBProp
07-11-2003, 07:59 PM
Hey! Congrats! 1000's a good mile-marker!

Alright, maybe I'm being a little vague...

You know how you can copy all of the information out of a javaScript command except for the <script></script> parts, throw that information into a text file and name it namehere.js? Then you go <script language="JavaScript" type="text/javascript" src="namehere.js"></script>...still with me?

Good...now I want to do that with a Java Applet (more sprecificly, the one in the line of code that I put up a few posts ago...). Are you saying that I can't just copy it to an external file and go
<applet src="namehere.class"></applet> ? I am only using it on one page, and it would just make my page validate a whole lot easier if I could export it.

Thanks!

-Ben

Nightfire
07-11-2003, 09:29 PM
I don't think you can do it that way. You could put the info into a function in a js file and just print it to the screen in the right place, just guessing though, it might not work

Ben@WEBProp
07-11-2003, 09:35 PM
Well I guess it doesn't matter that much, because as it turns out, all of the applet data validates just fine! It would help to save some space, but it doesn't seem time-efficient to figure out.

I am still having a problem with the validation of the page though. It is telling me that there is no height attribute for the <table> tag. I could have sworn that there was a height attribute! If I don't have a height attribute, what will govern the vertical length? the height attribute of the <td>'s?

Thanks for all the help!

-Ben

oracleguy
07-11-2003, 09:51 PM
You have to use CSS for the height attribute.

style="height: 100%;"

Ben@WEBProp
07-11-2003, 10:14 PM
This is my last post for this thread, I promise!

Is it absolutely necessary for a height attribute to be present in a table or <td>? If it is, how do I set up the whole css thing? I don't know any, so you will have to give it to me line by line...

-Ben

Nightfire
07-12-2003, 12:10 AM
I see no need to add height at all, as the td will extend to the height needed automatically

giz
07-12-2003, 12:31 AM
>> It is telling me that there is no height attribute for the <table> tag. <<


That means that it is telling you that height does not exist in the HTML specification that you are validating against.

It is telling you that you used it in your page, and that it is an error in your coding as far as the validator is concerned, and that you should remove it.