Reply to xhtml strict javascript problem trying to use "id" in plane of "name" attribute

Your name:

Reply:


Posted by meyazoo on 08/28/07 00:07

I have tried to resolve this in several ways that I have found on the
internet, but none seems to work. Here is the shortened code which is
a website displaying a webcam. The .jpg is overwritten with new image
from the camera. This code works, but does not pass W3C XHTML
STRICT.

1) How can I keep this working, and change the attribute to "id" so is
passes STRICT?
2) While I'm asking questions, what purpose does the "//" in the //<!
[CDATA[ line perform? When I read the spec (http://www.w3.org/TR/
xhtml1/) it only says to use <![CDATA[ ?

MY CODE ***************************************
***************************************************

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Camsite</title>
<script type="text/javascript">
//<![CDATA[

function refreshIMG()

{
var trimmedPath=new Array();

var currentPath=document.image3.src;
trimmedPath=currentPath.split("?");
document.image3.src = trimmedPath[0] + "?" +
Math.random();

setTimeout("refreshIMG()", 8*1000);
}

//]]>
</script>
</head>

<body onload="refreshIMG()">
<h4>CAM_3</h4>
<div>
<img class="cam" src="images/cam_3.jpg" width="320"
height="240" name="image3" alt="Image loading ..." id="image3" />
</div>
</body>
</html>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация