/    Sign up×
Community /Pin to ProfileBookmark

Change a Java Script to Sever Side Script

Can some one change this to PHP please?

<html>
<head>
<script language=”JavaScript1.1″>

var locationAfterPreload = “http://www.anyweb.com”
var lengthOfPreloadBar = 150
var heightOfPreloadBar = 15

var yourImages = new Array(“http://www.anyweb.com/images/logo.gif”)

if (document.images) {
var dots = new Array()
dots[0] = new Image(1,1)
dots[0].src = “images/web/black.gif”
dots[1] = new Image(1,1)
dots[1].src = “images/web/blue.gif”
var preImages = new Array(),coverage = Math.floor(lengthOfPreloadBar/yourImages.length),currCount = 0
var loaded = new Array(),i,covered,timerID
var leftOverWidth = lengthOfPreloadBar%coverage
}
function loadImages() {
for (i = 0; i < yourImages.length; i++) {
preImages[i] = new Image()
preImages[i].src = yourImages[i]
}
for (i = 0; i < preImages.length; i++) {
loaded[i] = false
}
checkLoad()
}
function checkLoad() {
if (currCount == preImages.length) {
location.replace(locationAfterPreload)
return
}
for (i = 0; i <= preImages.length; i++) {
if (loaded[i] == false && preImages[i].complete) {
loaded[i] = true
eval(“document.img” + currCount + “.src=dots[1].src”)
currCount++
}
}
timerID = setTimeout(“checkLoad()”,10)
}
// end hiding –>
</script>

</head>

<body>

<center>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p class=”preload”>Loading Entier Web. Please be patient …..</p>
<p>

<script language=”JavaScript1.1″>
<!– begin hiding
if (document.images) {
var preloadBar = ”
for (i = 0; i < yourImages.length-1; i++) {
preloadBar += ‘<img src=”‘ + dots[0].src + ‘” width=”‘ + coverage + ‘” height=”‘ + heightOfPreloadBar + ‘” name=”img’ + i + ‘” align=”absmiddle”>’
}
preloadBar += ‘<img src=”‘ + dots[0].src + ‘” width=”‘ + (leftOverWidth+coverage) + ‘” height=”‘ + heightOfPreloadBar + ‘” name=”img’ + (yourImages.length-1) + ‘” align=”absmiddle”>’
document.write(preloadBar)
loadImages()
}
document.write(‘<p><small><a href=”javascript:window.location=locationAfterPreload”>Skip Preloading</a></small></p>’)
// end hiding –>
</script>
</center>

</body>
</html>

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@mityaOct 23.2004 — What on earth do you mean? Do you mean simply in terms of syntax or actually make the script's end result the same too?

If the latter, are you aware JS is client-side and has totally different capabilities to PHP?

You're unlikely to get someone to write you a script. This forum is for help... you do it and we'll give you pointers if you get stuck.

Regards.
×

Success!

Help @GenerationX 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.8,
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,
)...