Screen Res Detection

| JavaScipt

by Gene Casanova; Codemaster, Author | Reviewed November 2012


Universal Internet Webpage Construction Research

JavaScript appears to be supported in new webpage-enabled and Internet-enabled mobile devices, which are spreading across the world; used in daily living and work places.   Therefore, developing highly-reliable dymanic intelligent level of code to provide a universal webpage construction-and-presentation in all currently used devices, is an absolute must.

These experimental processes below are part of my research.

Example Processes - Experimental

1) Detect a specific screen resolution, then process basic logic to determine which webpage to serve to the browser:

<script language="JavaScript">
<!--
  if ((screen.width>=1024) && (screen.height>=768))
   {window.location="highres.html";}
  else
   {window.location="lowres.html";}
//-->
</script>

2) Detect the screen resolution of the device running this code in a web-browser.  This code produces a standard HTML <link> element, linking to a standard JavaScript function "alter".  This function prompts the browser to display its alert window with the message provided within the brackets():

<a href="javascript:alert ('Screen Resolution Is : '+screen.width+'x'+screen.height);">
Click Here For Screen Resolution</a>

Click Here For Screen Resolution

Work In Progress....

My Research, My Work, My Passion.  I use documentation writing, as my form of a personal learning process (enlightening my brain).  As I progress through searching for documentation, reading and translating found documentation, and conceiving code experimentations, I document and author my findings; sharing the basic knowledge.

Any optimal coding I develop and/or discover, is retained as personal intellectual capitol property; made available through my exclusive valued consulting service, board member service, engineering, development project leadership, etc.... (For Hire).

Please regard this published work as an unfinished journal of valuable refined information for your consideration; based on my vast research and direct code experimentation combined with over 30 years of optimal computing languages process engineering, authoring, revising, deployment and implementation in computing science research and real-time commercial applications.

Cheers, Gene Casanova, Codemaster