/    Sign up×
Community /Pin to ProfileBookmark

Redirect in game not working in IE

Hi all,

I’m new, so a big hello first.

I’m writing a game in JS, see it here first:
[URL=http://www.ralpharama.co.uk/java/Dig%20Jig/]http://www.ralpharama.co.uk/java/Dig%20Jig/[/URL]

After the end if the game, you type in your name, then you should be redirected to the highscores page. This works fine in Mozilla, Firefox, but not in IE. I’ve done redirects in IE before, but can’t seem to get this to work. I’ve tried every combination of redirect that I could find, e.g.:

location.replace(locn);
location.href=locn;

Etc… None seem to redirect.. It just sits there….

If you want to view the code, just view the source of the page:
[URL=http://www.ralpharama.co.uk/java/Dig%20Jig/digjig.php]http://www.ralpharama.co.uk/java/Dig%20Jig/digjig.php[/URL]
The redirect is near the bottom:

[CODE] function gameOver()
{
var name = prompt(‘Game Over!nnBut, you may have a high score!nnSo, Enter your name:’,”);
if (name==”) name=”Anon”;
var locn = “highscore.php?d=”+diamonds+”&t=”+seconds+”&n=”+name+”&l=”;
location.replace(locn);
location.href=locn;
}[/CODE]

(PHP inserts some dynamic values into the code in case you were wondering)

Any suggestions / help, much appreciated.

I’ll check this post daily, and let you know if I resolve it.

Cheers,

R.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@FangMay 14.2005 — Works in IE5+ winxp
Copy linkTweet thisAlerts:
@RalpharamaauthorMay 16.2005 — Works in IE5+ winxp[/QUOTE]

Yes, I think you didn't understand (probably my wording) - I'm using IE 5+ and winxp, and though this redirect normally works, it doesn't seem to in this context. If anyone can try the page in IE and let me know if it works for them, I'd appreciate it.

(Press ESC in game, type a name and see if you're redirected to the highscores page, or if you just stay on the same page!)

Thanks,

Ralph
×

Success!

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