/    Sign up×
Community /Pin to ProfileBookmark

Having Trouble With Timer(s) and Loading URL

Having problems with this code, can someone help please…?

<html>
<head>
<meta content=”text/html;charset=ISO-8859-1″ http-equiv=”Content-Type”>
<title>PSP_HTML_BootSCR</title>
<script language=”javascript”>

var id = setTimeout(“startOS();”, 6000);

function startOS(){
window.location.href=”file:/sys/AceOS.html”;
}
</script>
</head>
<body style=”background-color: rgb(0, 0, 0); color: rgb(0, 0, 0);”
onload=”id();” alink=”#ee0000″ link=”#0000ee” vlink=”#551a8b”>
<span style=”color: rgb(255, 255, 255);”><img
style=”width: 387px; height: 213px;” alt=””
src=”file:/GIF/YODA_Boot.gif”></span>
</body>
</html>

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@Four_StaplesJun 07.2009 — Remove your body's onload attribute. id isn't a function, it's a variable-- it's defined (and as a result, the timer is set) on page load.

It also seems as though you were using curly quotes in your window.location.href definition, which a browser does not recognize as regular quotes. Are you editing in a word processor such as word? It could also just be the forums formatting it strangely since your post wasn't in [[b][/b]code] tags.

Anyway, here is the working code ?&lt;html&gt;
&lt;head&gt;
&lt;meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"&gt;
&lt;title&gt;PSP_HTML_BootSCR&lt;/title&gt;
&lt;script language="javascript"&gt;

var id = setTimeout("startOS();", 6000);

function startOS(){
window.location.href="file:/sys/AceOS.html";
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body style="background-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"
alink="#ee0000" link="#0000ee" vlink="#551a8b"&gt;
&lt;span style="color: rgb(255, 255, 255);"&gt;&lt;img
style="width: 387px; height: 213px;" alt=""
src="file:/GIF/YODA_Boot.gif"&gt;&lt;/span&gt;
&lt;/body&gt;
&lt;/html&gt;
Copy linkTweet thisAlerts:
@UnknownUserAceauthorJun 07.2009 — Remove your body's onload attribute. id isn't a function, it's a variable-- it's defined (and as a result, the timer is set) on page load.

It also seems as though you were using curly quotes in your window.location.href definition, which a browser does not recognize as regular quotes. Are you editing in a word processor such as word? It could also just be the forums formatting it strangely since your post wasn't in [[b][/b]code] tags.

Anyway, here is the working code ?&lt;html&gt;
&lt;head&gt;
&lt;meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"&gt;
&lt;title&gt;PSP_HTML_BootSCR&lt;/title&gt;
&lt;script language="javascript"&gt;

var id = setTimeout("startOS();", 6000);

function startOS(){
window.location.href="file:/sys/AceOS.html";
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body style="background-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"
alink="#ee0000" link="#0000ee" vlink="#551a8b"&gt;
&lt;span style="color: rgb(255, 255, 255);"&gt;&lt;img
style="width: 387px; height: 213px;" alt=""
src="file:/GIF/YODA_Boot.gif"&gt;&lt;/span&gt;
&lt;/body&gt;
&lt;/html&gt;
[/QUOTE]

Thanx, I got it working now, thanx for the help.

<body style="background-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"

onload="MyEvent()" alink="#ee0000" link="#0000ee" vlink="#551a8b">

<script language="JavaScript">

function LoadURL(){

window.location = 'file:/sys/AceOS.html'

}

function MyEvent(){

var id = setTimeout ("LoadURL();", 15000);

}

</script>

Thanx for The Reply to my question.

~ Ace&#8482;
×

Success!

Help @UnknownUserAce 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 10.3,
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: @ddiebold17,
tipped: article
amount: 1000 SATS,

tipper: @Mqlinka19,
tipped: live stream
amount: 4900 SATS,

tipper: @Mqlinka19,
tipped: article
amount: 10 SATS,
)...