Forum Moderators: open

Message Too Old, No Replies

W3 validation tool

JS problem

         

henry0

4:57 pm on Oct 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The W3 tool has found errors in a "valid JS script" for example
<<<
Line 54, column 18: there is no attribute "LANGUAGE" (explain...).
<script LANGUAGE= Java script>
>>>
what should I do?
here is my doctype:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transactional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

thanks

regards
Henry

Sinner_G

5:00 pm on Oct 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Shouldn't that be looking like this?

<script type="text/javascript">

macrost

5:12 pm on Oct 5, 2003 (gmt 0)

10+ Year Member



try <script type="text/javascript" language="javascript"></script>

Mac

henry0

5:50 pm on Oct 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thank you very much that one did it
<script type="text/javascript">

Mohamed_E

6:02 pm on Oct 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I believe that
  • <script LANGUAGE= Javascript> is invalid in any level of 4.01
  • <script type="text/javascript" language="javascript"></script> is valid in 4.01 Transitional only, while
  • <script type="text/javascript"> is valid in 4.01 Strict.

The joys of Strict :) :)

<edit> Corrected real errors in first draft</edit>

scootertopia

6:11 pm on Oct 5, 2003 (gmt 0)

10+ Year Member



Hello Everyone, I am new at this and generally lurk. I use tidyui
[users.rcn.com...]

it works for me, hope this helps,
Mike

henry0

6:45 pm on Oct 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



the Joy of XHTML
I spent too much time on prging PHP and not enough on validation
it's pay back time :)
thanks
regards

Mohamed_E

7:12 pm on Oct 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld, scootertopia!

I am sure you learned a lot while lurking, but the full value of this board is best obtained by participating. So I hope that your "unlurking" is permanent.

I also use Tidy, but from the command line. It is an excellent tool.

scootertopia

7:20 pm on Oct 5, 2003 (gmt 0)

10+ Year Member



Thank you for the welcome. I am on the new side of all of this, very new, but i will chime in whenever I can help. Learning plenty thanks to all of you.
Thanks again,
Mike

keyplyr

5:32 am on Oct 6, 2003 (gmt 0)

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



<script LANGUAGE= Javascript> is invalid in any level of 4.01
<script type="text/javascript" language="javascript"></script> is valid in 4.01 Transitional only, while
<script type="text/javascript"> is valid in 4.01 Strict

Actually, the language="javascript" part is deprecated period.

<script type="text/javascript"> validates in strict and transitional.

henry0

1:36 pm on Oct 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



well I am almost there however

<body topmargin= "0" marginheight= "0" marginwidth= "0">

w3 validator has a problem with the above line

Line 55, column 17: there is no attribute "topmargin" (explain...).

the validator is pointing to each double quotes such as "0"
I tried attaching the "0" to the = sign but it does not work!

I am in DTD transitional mode

Lorel

2:19 pm on Oct 6, 2003 (gmt 0)

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



I just noticed a problem with W3G:

It finds errors in every shopping cart or classified link I provide on my sites. Is there a way to fix those URLs so they will validate in W3g?

thanks

RonPK

2:25 pm on Oct 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> <body topmargin= "0" marginheight= "0" marginwidth= "0">

This can be accomplished with CSS :

body {
margin: 0
}

RonPK

2:27 pm on Oct 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Lorel,
Making a wild guess: replace any & in your URLs with &amp;

henry0

2:33 pm on Oct 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



RonPK
I did have the same idea :)
I was going to post the following
it is only a half way fix since it does not address the problem but kill it!

indeed deleting the line and adding
body {margin-top: 0px;margin-height: 0px; margin-width: 0px;} in my remote .css does the job
thanks

Sinner_G

2:36 pm on Oct 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



it does not address the problem

Well, the problem is topmargin isn't (and hasn't ever been) part of any HTML standard.

pageoneresults

2:39 pm on Oct 6, 2003 (gmt 0)

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



The correct way of making sure that you have absolute zero margins in all browsers would be this...

body {
top:0;
left:0;
margin:0;
padding:0;
}

henry0

3:34 pm on Oct 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



got it
thank you very much

henry0

3:43 pm on Oct 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I hate to be a bug
it works as far as seting value to "0"
however experimenting with
for ex : top:100; or 100px; or em;
does not product any effect on the page display
reason?
thanks again

DrDoc

6:20 pm on Oct 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Neither should it... Top and left are positioning attributes. By default the position of all elements on a page is "static" = they are not positioned.

top: 0;
left: 0;
...is pointless without positioning.

margin: 0;
padding: 0;
...should be sufficient enough for all browsers. Just remember to apply the zero margin/padding to both html and body.

pageoneresults

6:31 pm on Oct 6, 2003 (gmt 0)

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



top: 0;
left: 0;
...is pointless without positioning.

There appears to be a bug in IE 5.1 on the Mac when using the position:absolute; on the body to control 0 margins (has to do with image backgrounds on the body and a <div>). I've since removed the position:absolute; and continue to use the top and left as shown above. Do I not need those attributes any more if not using the position: attribute?

DrDoc

7:15 pm on Oct 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You shouldn't need them. If a browser handles positioning at least semi-correctly (and now we're down to the standard of NN4) top and left (and bottom and right) are always applied in reference to something else, depending on the type of positioning. And, since the default positioning is "static" the values should have no effect whatsoever.

pageoneresults

8:40 pm on Oct 6, 2003 (gmt 0)

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



Cool, thanks DrDoc!

Just remember to apply the zero margin/padding to both html and body.

I've been seeing more and more use of the html tag in css. What gives with that? I didn't know you could apply margins/padding, etc. to the html tag.

DrDoc

8:58 pm on Oct 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In XHTML the html tag is the "root" tag... so that's why