/    Sign up×
Community /Pin to ProfileBookmark

Page Redirect based on OS and Browser

Hello,

scenario:

a flash site has been made,
client worries people using 64bit MSIE 8 wont see it.
want to detect 64bit IE8 version and if so redirect to another page

I know almost nothing about javascript, only how to noobishly copy and paste..

the code that makes sense to me is along the lines of:

<!–
var browserVer=parseInt(navigator.platform);
if (browserVer=Win64)
{
window.location=”green.html”;
}
else
{
window.location=”red.html”;
}
//–>

or

<script language=”javascript”>
<!–
function detectOS()

if OS==(“Win64”){
window.location.replace(“green.html”)
}
else {
};

//–>
</script>

none of these seem to work and I cant find someone doing something similar,
it seems like it would be useful because of the known incompatibility…

if anyone can understad this as easy as they breathe, please lend a hand…

cheers

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@KorMar 25.2010 — Try rather a regexp match:
<i>
</i>if(navigator.platform.match(/Win64/gi)){
...
}
Copy linkTweet thisAlerts:
@CopyandpasteauthorMar 30.2010 — if(navigator.platform.match(/Win64/gi)){

...

}

this enabled me to redirect based on OS, thanks!

what does the "gi" represent?
×

Success!

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