/    Sign up×
Community /Pin to ProfileBookmark

Ok, at JavascriptSource I found this script, [url]http://javascript.internet.com/user-details/resolution-page.html[/url] which allows me to send users to different pages depending on their screen resolution, example: 800×600 and 1024×768. I only have one problem, that script works by users click enter and it takes them to the correct page, but i’d like to know if its possible to send them automatically to the correct page. Im building a splash screen for my site and one is going to be 800×600 and the other 1024×768 but i’d like it so when a user goes to my site, [url]http://www.digitalchronic.com[/url] , they will be redirected to the right splash size.

Thanks,
!¡¤NiCeGuY¤¡!

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@khalidali63Mar 08.2003 — If you look a the code you will se that you have a function call in the buttons on click event.

<input type=button value="Enter!" onClick="redirectPage()">

what you need to do is remove this from that buton or if you do not need that button then remove it altogether.

then add this line in right before you see </script>

tag.

window.onload = redirectPage;

This should take care of your concern..

cheers

Khalid
Copy linkTweet thisAlerts:
@_____NiCeGuY_____authorMar 08.2003 — Thanks

!¡¤NiCeGuY¤¡!
Copy linkTweet thisAlerts:
@pyroMar 08.2003 — Or, you could simply delete out the function so you are left with this:

&lt;script language="javascript" type="text/javascript"&gt;

var url640x480 = "http://www.yoursite.com/640x480";
var url800x600 = "http://www.yoursite.com/800x600";
var url1024x768 = "http://www.yoursite.com/1024x768";
if ((screen.width == 640) &amp;&amp; (screen.height == 480))
window.location.href= url640x480;
else if ((screen.width == 800) &amp;&amp; (screen.height == 600))
window.location.href= url800x600;
else if ((screen.width == 1024) &amp;&amp; (screen.height == 768))
window.location.href= url1024x768;
else window.location.href= url640x480;

&lt;/script&gt;
×

Success!

Help @_____NiCeGuY_____ 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.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

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