The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
JavaScript XHTML 1.0 Trans HELP!
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=ht...doctype=Inline Here is what I have in my template header (to randomly select header): Code:
<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: Code:
<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-x...624/#post58548 |
#2
|
||||
|
||||
I recommend saving all javascript externally whenever possible.
|
#3
|
|||
|
|||
Would it be possible to turn this into a simple PHP script instead and insert it into the template? If not is there another way to do this? I would like to remove the javascript all together to clean up the code to content ratio.
Thank's Joe |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|