XHTML Strict 1.0 document fails due to some javacript

I have a whole website which is passing the XHTML Strict 1.0 validation, however I have one page which is failing due to a section of javascript on the page.

It fails on the following;

<script type="text/javascript">
// Detect if flash installed, if so, show flash, if not, show HTML
var so = new SWFObject("flash/home.swf", "mainFlash", "780", "490",8,'#96a3b1');
so.write("flashcontent");

// Check if flash is available, and if so then unhide the div with content
function getFlashObj(movie){
if (window.document[movie]) {
document.getElementById('flash_text').style.display = 'block';
return window.document[movie];                        
}
if (navigator.appName.indexOf("Microsoft Internet")==-1) {
if (document.embeds && document.embeds[movie]) {
return document.embeds[movie];
}
} else {
return document.getElementById(movie);
}
}
getFlashObj('mainFlash');
</script>

The point it seems to fail at is anywhere where it has && 

Can anyone help with this.
AlivewithTechnologyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hernst42Commented:
For XHTML use CDATA-tags like:

<script language="JavaScript" type="text/javascript">
/* <![CDATA[ */
 
// Check if flash is available, and if so then unhide the div with content
function getFlashObj(movie){
if (window.document[movie]) {
document.getElementById('flash_text').style.display = 'block';
return window.document[movie];                        
}
if (navigator.appName.indexOf("Microsoft Internet")==-1) {
if (document.embeds && document.embeds[movie]) {
return document.embeds[movie];
}
} else {
return document.getElementById(movie);
}
}
getFlashObj('mainFlash');
/* ]]> */
</script>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AlivewithTechnologyAuthor Commented:
Absolutely spot on, thank you
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.