homepage Welcome to WebmasterWorld Guest from 54.227.215.139
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
HELP on setting cookie as per screen resolution.
How can I set a cookie with user's screen resolution to low?
fredfletcher



 
Msg#: 4368017 posted 9:58 pm on Sep 27, 2011 (gmt 0)

Hello all,

Wondering if someone can help me with this. I would like to set/create a single-use/temporary "cookie" for the duration of the user's session or possibly for up to 2 days and have a popup alert box, telling them that their screen resolution is too low to view.

I have searched far and wide to see how it could be done, but I was not successful. I spent the better part of 2 hours on the Internet today, can you help me?

Thank you. Here is my existing Javascript below. Could someone implement and/or rewrite it with the cookie? I would appreciate it very much.

<script type="text/javascript">

<!--

if (screen.height<768 || screen.width<1024) alert ("Your screen's resolution is below 1024x768.\nThis site works better at higher resolutions.");

// -->


</script>

 

lucy24

WebmasterWorld Senior Member lucy24 us a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



 
Msg#: 4368017 posted 12:29 am on Sep 28, 2011 (gmt 0)

Gosh, this question sounds familiar. Anyone up for a fistfight?

[webmasterworld.com...]

fredfletcher



 
Msg#: 4368017 posted 2:13 pm on Sep 28, 2011 (gmt 0)

Oohhh please, no need to fight over 'lil 'ol me, hahaha!

rocknbil

WebmasterWorld Senior Member rocknbil us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4368017 posted 5:31 pm on Sep 28, 2011 (gmt 0)

Well, that link will give you an answer - but long story short, dictating to the user what environment they need to have to view your site tells you one thing, and one thing only: you're doing something wrong. :-)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved