Jump to content

Recommended Posts

Posted (edited)

WPI v5.0

added the code below under the part on the bottom bar where it says "WPI Version X"

and now it doesn't load my programs up in the middle. If I remove the below code they come back... why is this code (it puts the current time in text) making a problem? and anyone know how I can fix it? TIA!

EDIT: btw- this is in the file wpi.htm in the theme folder (Glossy)

<span id=tod>

</span>

<script>

function showtod(){

if (!document.all&&!document.getElementById)

return

thelement=document.getElementById? document.getElementById("tod"): document.all.tod

var todDisplay=new Date()

var hours=todDisplay.getHours()

var minutes=todDisplay.getMinutes()

var seconds=todDisplay.getSeconds()

var ampm="PM"

if (hours<12)

ampm="AM"

if (hours>12)

hours=hours-12

if (hours==0)

hours=12

if (minutes<=9)

minutes="0"+minutes

if (seconds<=9)

seconds="0"+seconds

var ctime=hours+":"+minutes+":"+seconds+" "+ampm

thelement.innerHTML="<b style='font-size:14;color:black;'>"+ctime+"</b>"

setTimeout("showtod()",1000)

}

window.onload=showtod

//-->

</script>

Edited by doablesandman

Posted (edited)

Hehe, there's a small mistake in your script.

Instead of

window.onload=showtod

Put

window.onload=showtod()

Edited by sadicq
Posted

thanks! that did it, I can't believe I didn't see that! Guess my professor was right when he said "After you finish make sure you have a second pair of eyes look at it before you turn it in." :)

Posted

And you don't need to do any extra browser compatibility checks since WPI only runs on IE/mshta, and JS is turned on by default when do a clean install.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...