citricguy
11-21-2006, 07:46 AM
I use a random image script at the top of my forums but cannot seem to get it to validate properly as "XHTML 1.0 Transitional".
http://validator.w3.org/check?uri=http%3A%2F%2Fwww.chaosforums.com%2F&charset=%28detect+automatically%29&doctype=Inline
Here is what I have in my template header (to randomly select header):
<script type="text/javascript">
var logo=new Array()
logo[0]='<img src="$stylevar[imgdir_misc]/logo1.gif" border="0" alt="$vboptions[bbtitle]" />'
logo[1]='<img src="$stylevar[imgdir_misc]/logo2.gif" border="0" alt="$vboptions[bbtitle]" />'
logo[2]='<img src="$stylevar[imgdir_misc]/logo3.gif" border="0" alt="$vboptions[bbtitle]" />'
logo[3]='<img src="$stylevar[imgdir_misc]/logo4.gif" border="0" alt="$vboptions[bbtitle]" />'
logo[4]='<img src="$stylevar[imgdir_misc]/logo5.gif" border="0" alt="$vboptions[bbtitle]" />'
logo[5]='<img src="$stylevar[imgdir_misc]/logo6.gif" border="0" alt="$vboptions[bbtitle]" />'
logo[6]='<img src="$stylevar[imgdir_misc]/logo7.gif" border="0" alt="$vboptions[bbtitle]" />'
var displaylogo=Math.floor(Math.random()*(logo.length) )
document.write(logo[displaylogo])
</script>
and here is what it outputs once it is sent to the browser:
<script type="text/javascript">
var logo=new Array()
logo[0]='<img src="http://www.chaosforums.com/images_black/misc/logo1.gif" border="0" alt="Chaos Forums" />'
logo[1]='<img src="http://www.chaosforums.com/images_black/misc/logo2.gif" border="0" alt="Chaos Forums" />'
logo[2]='<img src="http://www.chaosforums.com/images_black/misc/logo3.gif" border="0" alt="Chaos Forums" />'
logo[3]='<img src="http://www.chaosforums.com/images_black/misc/logo4.gif" border="0" alt="Chaos Forums" />'
logo[4]='<img src="http://www.chaosforums.com/images_black/misc/logo5.gif" border="0" alt="Chaos Forums" />'
logo[5]='<img src="http://www.chaosforums.com/images_black/misc/logo6.gif" border="0" alt="Chaos Forums" />'
logo[6]='<img src="http://www.chaosforums.com/images_black/misc/logo7.gif" border="0" alt="Chaos Forums" />'
var displaylogo=Math.floor(Math.random()*(logo.length) )
document.write(logo[displaylogo])
</script>
Do you see anything right off that I could change that could help me validate this script as XHTML 1.0 Trans?
----------------------------------------------------------------------------------------
AUTOMERGED DOUBLEPOST
Thank you Oleg over at vbseo.com, answer is at
http://www.vbseo.com/f4/javascript-xhtml-validation-help-9624/#post58548
http://validator.w3.org/check?uri=http%3A%2F%2Fwww.chaosforums.com%2F&charset=%28detect+automatically%29&doctype=Inline
Here is what I have in my template header (to randomly select header):
<script type="text/javascript">
var logo=new Array()
logo[0]='<img src="$stylevar[imgdir_misc]/logo1.gif" border="0" alt="$vboptions[bbtitle]" />'
logo[1]='<img src="$stylevar[imgdir_misc]/logo2.gif" border="0" alt="$vboptions[bbtitle]" />'
logo[2]='<img src="$stylevar[imgdir_misc]/logo3.gif" border="0" alt="$vboptions[bbtitle]" />'
logo[3]='<img src="$stylevar[imgdir_misc]/logo4.gif" border="0" alt="$vboptions[bbtitle]" />'
logo[4]='<img src="$stylevar[imgdir_misc]/logo5.gif" border="0" alt="$vboptions[bbtitle]" />'
logo[5]='<img src="$stylevar[imgdir_misc]/logo6.gif" border="0" alt="$vboptions[bbtitle]" />'
logo[6]='<img src="$stylevar[imgdir_misc]/logo7.gif" border="0" alt="$vboptions[bbtitle]" />'
var displaylogo=Math.floor(Math.random()*(logo.length) )
document.write(logo[displaylogo])
</script>
and here is what it outputs once it is sent to the browser:
<script type="text/javascript">
var logo=new Array()
logo[0]='<img src="http://www.chaosforums.com/images_black/misc/logo1.gif" border="0" alt="Chaos Forums" />'
logo[1]='<img src="http://www.chaosforums.com/images_black/misc/logo2.gif" border="0" alt="Chaos Forums" />'
logo[2]='<img src="http://www.chaosforums.com/images_black/misc/logo3.gif" border="0" alt="Chaos Forums" />'
logo[3]='<img src="http://www.chaosforums.com/images_black/misc/logo4.gif" border="0" alt="Chaos Forums" />'
logo[4]='<img src="http://www.chaosforums.com/images_black/misc/logo5.gif" border="0" alt="Chaos Forums" />'
logo[5]='<img src="http://www.chaosforums.com/images_black/misc/logo6.gif" border="0" alt="Chaos Forums" />'
logo[6]='<img src="http://www.chaosforums.com/images_black/misc/logo7.gif" border="0" alt="Chaos Forums" />'
var displaylogo=Math.floor(Math.random()*(logo.length) )
document.write(logo[displaylogo])
</script>
Do you see anything right off that I could change that could help me validate this script as XHTML 1.0 Trans?
----------------------------------------------------------------------------------------
AUTOMERGED DOUBLEPOST
Thank you Oleg over at vbseo.com, answer is at
http://www.vbseo.com/f4/javascript-xhtml-validation-help-9624/#post58548