/    Sign up×
Community /Pin to ProfileBookmark

non -java way of detecting browser width and redirecting?

Hi

Just wondering if there is a non -java way of detecting a user’s browser width and then redirecting to the appropriate version of my site?

Cheers

Shaun

to post a comment
HTML

7 Comments(s)

Copy linkTweet thisAlerts:
@scragarMay 10.2009 — It's javascript, not java, the two are very different.

No matter what technology you try to use to detect the browsers dimentions there will ALWAYS be users without it, ask or assume a reasonable size.

PS: You are shooting yourself in the foot maintaining several different sized versions of your site, you realise that, right?
Copy linkTweet thisAlerts:
@billygoatkaraokauthorMay 10.2009 — Cheers Scragar

How so?
Copy linkTweet thisAlerts:
@kenderMay 10.2009 — just use something like....
.wrapper {
min-width: 780px;
max-width: 1260px;
width:expression(document.body.clientWidth < 782? "780px" : document.body.clientWidth > 1262? "1260px" : "auto");

}

that would cover from people with 800x600 to people with 1280x1024
Copy linkTweet thisAlerts:
@FangMay 10.2009 — Don't use expression
Copy linkTweet thisAlerts:
@kenderMay 10.2009 — well, put in an identifier, if browser is IE and before version 8, use expression if its IE8, or FF, or Chrome ignore
Copy linkTweet thisAlerts:
@felgallMay 10.2009 — That expression code is JScript and will be disabled if Acrive Scripting is turned off just the same as any J(ava)Script solution would be.
×

Success!

Help @billygoatkaraok 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 6.14,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

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