/    Sign up×
Community /Pin to ProfileBookmark

Nothing will work for this code…

Hey I have tis script that will not work in e107 because it uses the onload command and I guess its in e107… I’ve created an external file called my.js and stuck this code in it.

[CODE]<!– Beginning of JavaScript –

// CREDITS:
// Dynamic world time ticker for your titlebar
// By Urs Dudli and Peter Gehrig
// Copyright (c) 2001 Peter Gehrig and Urs Dudli. All rights reserved.
// Permission given to use the script provided that this notice remains as is.
// Additional scripts can be found at <a href=”http://www.24fun.com” rel=”external”>[link]</a> & <a href=”http://www.designerwiz.com” rel=”external”>[link]</a>
// <a rel=’external’ href=’javascript:window.location=”mai”+”lto: “+”info”+”@”+”24fun.com”;self.close();’ onmouseover=’window.status=”mai”+”lto: “+”info”+”@”+”24fun.com”; return true;’ onmouseout=’window.status=””;return true;’>[email]</a>
// 5/8/2001

// IMPORTANT:
// If you add this script to a script-library or script-archive
// you have to add a highly visible link to
// <a href=”http://www.24fun.com” rel=”external”>[link]</a> on the webpage
// where this script will be featured

// CONFIGURATION:
// Go to <a href=”http://www.24fun.com,” rel=”external”>[link]</a> open category ‘date’ and download the script

var hours
var shifthours
var minutes
var seconds
var localhours
var pause=2000
var thisplace
var i_worldtime=0
var timer

var worldtime = new Array()

worldtime[0]=”Azores,-1″
worldtime[1]=”Baghdad,4″
worldtime[2]=”Berlin,2″
worldtime[3]=”Buenos Aires,-3″
worldtime[4]=”Chicago,-5″
worldtime[5]=”Denver,-6″
worldtime[6]=”Hong Kong,8″
worldtime[7]=”Honolulu,-10″
worldtime[8]=”Johannesburg,2″
worldtime[9]=”Kairo,3″
worldtime[10]=”Lima,-5″
worldtime[11]=”London,1″
worldtime[12]=”Los Angeles,-7″
worldtime[13]=”Mexico City,-5″
worldtime[14]=”Moscow,4″
worldtime[15]=”New York,-4″
worldtime[16]=”Paris,2″
worldtime[17]=”Perth,8″
worldtime[18]=”Sao Paulo,-3″
worldtime[19]=”Sydney,10″
worldtime[20]=”Tokyo,9″

function showtime() {
if (document.all) {
thisplace=worldtime[i_worldtime].split(“,”)
thistime= new Date()
hours=thistime.getUTCHours()
hours=eval(hours)
shifthours=eval(thisplace[1])
localhours=eval(shifthours+hours)
if (localhours <0) {localhours=24+localhours}
if (localhours >=24) {localhours=localhours-24}

minutes=thistime.getUTCMinutes()
seconds=thistime.getUTCSeconds()

if (thisplace[0]==’Delhi’) {
minutes=eval(minutes+30)
if (minutes>=60) {
minutes=eval(minutes-60)
localhours=eval(localhours+1)
}
}
if (eval(minutes) < 10) {minutes=”0″+minutes}
if (eval(seconds) < 10) {seconds=”0″+seconds}
if (eval(localhours) < 10) {localhours=”0″+localhours}
thistime = localhours+”:”+minutes+”:”+seconds
document.title=” —— “+thistime+” — >>> “+thisplace[0]+” <<< ———————————”
i_worldtime++
if (i_worldtime>=worldtime.length) {
i_worldtime=0
}
timer =setTimeout(“showtime()”,pause)
}
}

if (document.all) {
window.onload=showtime
}

// – End of JavaScript – –>

[/code]

I then loaded these lines into my theme.php file

[code]
function theme_head() { return ”
<script type=’text/ javascript’ src='”.THEME.”‘ my.js’></script>”;
} [/CODE]

///I tried different onload commands and what have you but still no go///

Any help will be much needed…

Thank you for your time and effort.

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @cecilgoode spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...