simi
asked on
reading screen size
Hi,
I want to read the screen resolution via javascript and send it to the server, then use it on the server side to size an applet.
Thanks.
I want to read the screen resolution via javascript and send it to the server, then use it on the server side to size an applet.
Thanks.
Try using screen.height and screen.width
good script. check it
cheers
umesh
<HTML>
<BODY>
<CENTER>
<SCRIPT LANGUAGE="JavaScript">
var screen_width = null;
var screen_height = null;
var resolution = null;
if (navigator.javaEnabled()) {
var toolkit = java.awt.Toolkit.getDefaul tToolkit() ;
var screen_size = toolkit.getScreenSize();
screen_width = screen_size.width;
screen_height = screen_size.height;
resolution = toolkit.getScreenResolutio n();
}
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
if ((screen_width != null)
&& (screen_height != null)
&& (resolution != null)) {
document.write('<center><h 1>Monitor Details:</h1><br><hr><br>' );
document.write('Screen Width: '+screen_width+'<BR>');
document.write('Screen Height: '+screen_height+'<BR>');
document.write('Screen Resolution: '+resolution+'<BR>');
document.write('</center>' );
}
else {
document.write('<center><P >');
document.write('I am sorry but we could not determine<P>');
document.write('the details of this screen. You might<P>');
document.write('not have Java enabled in this browser.<P>');
document.write('</center>' );
}
</SCRIPT>
</CENTER>
cheers
umesh
<HTML>
<BODY>
<CENTER>
<SCRIPT LANGUAGE="JavaScript">
var screen_width = null;
var screen_height = null;
var resolution = null;
if (navigator.javaEnabled()) {
var toolkit = java.awt.Toolkit.getDefaul
var screen_size = toolkit.getScreenSize();
screen_width = screen_size.width;
screen_height = screen_size.height;
resolution = toolkit.getScreenResolutio
}
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
if ((screen_width != null)
&& (screen_height != null)
&& (resolution != null)) {
document.write('<center><h
document.write('Screen Width: '+screen_width+'<BR>');
document.write('Screen Height: '+screen_height+'<BR>');
document.write('Screen Resolution: '+resolution+'<BR>');
document.write('</center>'
}
else {
document.write('<center><P
document.write('I am sorry but we could not determine<P>');
document.write('the details of this screen. You might<P>');
document.write('not have Java enabled in this browser.<P>');
document.write('</center>'
}
</SCRIPT>
</CENTER>
what about
document.body.clientHeight and document.body.clientWidth
this will give you the inner width of the viewable area of the browser
document.body.clientHeight
this will give you the inner width of the viewable area of the browser
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.