Computing.Net > Forums > Web Development > xhtml validation errors using

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

xhtml validation errors using

Reply to Message Icon

Name: lucky1
Date: April 16, 2005 at 09:54:03 Pacific
OS: win98 se
CPU/Ram: amd 1.4 / 512
Comment:

Hi Guy's & Gal's,

I'm stumpted !!! and I'm trying to learn.

Tried searching and came up zipped.

I am trying to validate my web site using XHTML. All frames except one are validated.

The one frame that will not validate uses the following ( embeded ) code:

<script
type="text/javascript">
if (navigator.userAgent.indexOf('MSIE') > -1)
{
document.write('<bgsound src="celine.mp3" loop="3" />');
} else {
document.write('<embed src= "celine.mp3" width="180" height="16" autoplay="true" loop="true" align="right" controller="true" />');
}
</script>

I am using <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

The web site works fine except for (Top.html) "validation".

http://www.claypenetration.com

lucky1



Sponsored Link
Ads by Google

Response Number 1
Name: Michael J (by mjdamato)
Date: April 16, 2005 at 18:35:46 Pacific
Reply:

Do some basic troubleshooting to find the cause.

First off, leave in the document.write statements, but have them write nothing to the page. If the page still does not validate, then you know it is the javascript. If the pages do validate, then you know it has something to do with the HTML code that the document.write statements are writing to the page.

Then go from there. For example, if you find that it is the HTML code in the JS that is causing the problem, try just one of them, then the other. You might find that only one of the statements is causing the error.

Michael J


0

Response Number 2
Name: Khalid
Date: April 17, 2005 at 00:17:53 Pacific
Reply:

Why are you using a different entity to play sounds for Internet Explorer? BGSOUND is not part of any HTML declaration at all but is a typical microsoft-html-element.
The EMBED-element isnt part of valid HTML either. To play sounds you can use the OBJECT-element with the required attribute "type" (in mime-format). The OBJECT-element is the only element that is part of XHTML.
In your case, try the following line to replace the whole javascript-code:

<OBJECT type="audio/mpeg" data="celine.mp3" width="180" height="16" align="right">
You browser doesnt support playing mp3-files.
</OBJECT>

Only this is valid HTML, although I can imagine it is not what you want. But in your quest to make sites that can be read and understand fully by ALL browsers, writing valid code is the first step...


0

Response Number 3
Name: lucky1
Date: April 17, 2005 at 15:36:51 Pacific
Reply:

Thanks Michael J and Khalid,

The problem must be in the code !!

Khalid, when I use the <object type></object> as you suggested, it works in Opera and Firefox but not in IE ????

I guess I will leave it alone and not worry over validating one page.

Thanks to you both as well as all the others that contribute to this forum.

I can't tell you how much I and perhaps many others that read and apply the information garnered from this form.

Thanks again. . . . . .

lucky1


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: xhtml validation errors using

XHTML Valid? www.computing.net/answers/webdevel/xhtml-valid/143.html

Validation Issues www.computing.net/answers/webdevel/validation-issues/1593.html

php counter in htm www.computing.net/answers/webdevel/php-counter-in-htm/1928.html