/    Sign up×
Community /Pin to ProfileBookmark

[code]<DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>
<html>
<head>
<noscript>
<meta http-equiv=”refresh” content=”1;URL=Index.html”>
</noscript>
<script language=”Javascript1.1″ type=”text/javascript”>
<!–
document.write(“<br><br><br><br><br><center><strong>HELLO</strong><br>Your browser will now cache site images…<br><br>”);
//Image preloading
var Images = new Array(3);
Images[0] = “Image1.jpg”;
Images[1] = “Image2.jpg”;
Images[2] = “Image3.jpg”;
//Preloads images via var array
for(x=0;x<Images.length;x++)
{
var preload = new Image();
preload.src=Images[x];
}
//Function for page redirection after images have been loaded
function doRedirect()
{
document.write(“Image caching completed…redirecting page”);
setTimeout(“window.location.href=’Index.html'”,3*1000);
}
//–>
</script>
</head>
<body onLoad=”doRedirect()”>
</body>
</html>[/code]


—————————————————————————————————————

On line 24 is the logic error that i am arriving at. The page will not print the first document.write at the beginning of the script, but prints only the text from the function…am i missing something?

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@NevermoreJun 27.2004 — document.write("<br><br><br><br><br><center><strong>HELLO</strong><br>Your browser will now cache site images...<br><br>");

Why not just write this one into the HTML by hand?
Copy linkTweet thisAlerts:
@CYberHackzauthorJun 27.2004 — I want to print text onto the screen before i begin preloading the images, then preload the images, then print that it is complete
×

Success!

Help @CYberHackz 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 5.18,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

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