/    Sign up×
Community /Pin to ProfileBookmark

Screen width/resolution

Is there a way to find out the clients screen width and screen resolution?

to post a comment

3 Comments(s)

Copy linkTweet thisAlerts:
@dthurman1432Jun 28.2006 — you can use a redirect such as:

<script>

var w = document.body.clientWidth;
if (w >= 650)
{
window.location.href = "bigscreen.asp";
}
else
{
window.location.href = "smallscreen.asp";
}


</script>
Copy linkTweet thisAlerts:
@nbcrockettauthorJun 28.2006 — Do you know of a vbscript version for that code and one that might give me their exact resolution. If not thanks this will give me something to work with. I'm guessing that to determine height you use clientHeight instead of clientWidth?
Copy linkTweet thisAlerts:
@buntineJun 29.2006 — Such information is not passed to the server via a page request. Certain external components (BrowserHawk) use some client-side method to determine resolution settings and repost the data to the server.

Basically, there is no server-side (ASP) equivelant. You will need some type of client-side processing.

Cheers.
×

Success!

Help @nbcrockett 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.24,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ,
analytics: Fullres
});

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: @Marika,
tipped: article
amount: 1000 SATS,

tipper: @hatem774,
tipped: article
amount: 1 SATS,

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