I use the code below to return the display height and width via hidden
fields in a form.

  out.println("<html>");
  out.println("<head>");
  out.println("<title>Description</title>");

  //Function to get Client document width and height
  out.println("<SCRIPT language=\"javascript\">");
  out.println("function getDims(Dim) {");
  out.println("var height, width;");
  out.println("if (document.all) height = document.body.offsetHeight, width
= document.body.offsetWidth;");
  out.println("else if (document.layers) height = window.innerHeight, width
= window.innerWidth;");
  out.println("if (Dim=='H') return height; else return width;");
  out.println("}");
  out.println("</SCRIPT>");

  out.println("</head>");
  out.println("<body>");

< HTML STUFF GOES IN HERE>


  // Get Client screen Width and Height
  out.println("<SCRIPT>document.write('<INPUT TYPE=\"hidden\" NAME=\"sw\"
VALUE=\"' + getDims(\"W\") + '\">');</SCRIPT>");
  out.println("<SCRIPT>document.write('<INPUT TYPE=\"hidden\" NAME=\"sh\"
VALUE=\"' + getDims(\"H\") + '\">');</SCRIPT>");






Regards,   Billy Graham.





-Ashok


-----Original Message-----
From: Youngho Cho [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 24, 2001 10:14 PM
To: [EMAIL PROTECTED]
Subject: Client Display Size


Hello,

Is there a way to know Client Browser Display Width and Height setting value
for example 800x600 or 1024x768 etc...

Thanks

youngho

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
*****************************************************************

This email has been Virus Scanned.

Privileged/Confidential Information and/or Copyright Material may
be contained in this e-mail. The information and Material is
intended for the use of the intended addressee. If you are not
the intended addressee, or the person responsible for delivering
it to the intended addressee, you may not copy or deliver it to
anyone else or use it in any unauthorised manner. To do so is
prohibited and may be unlawful. If you receive this e-mail by
mistake, advise the sender immediately by using the reply
facility in your e-mail software.


Thank you.
Information Technology Department
Belfast City Hospital Trust

*****************************************************************

Reply via email to