-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
I'm trying to get browser width/height using java script, unable to execute java script ,its giving error. Please help me out.
<script type="text/javascript"><![CDATA[
function getBrowserWidth()
{
return document.compatMode=='CSS1Compat'&&!window.opera?document.documentElement.clientWidth:document.body.clientWidth;
}
function getBrowserHeight()
{
return document.compatMode=='CSS1Compat'&&!window.opera?document.documentElement.clientHeight:document.body.clientHeight;
}
]]></script>
<window id="wind" width="" onClientInfo="getBrowserWidth()">
</window>
Thanks,
Dhana
Hi,
1.Any error message?
2.Searching on forum with keyword browser width you will get others' solutions and issues,
for example,http://www.zkoss.org/forum/index.zul#path%3DlistComment%3BdiscussionId%3D7367%3BcategoryId%3D14%3B
Hi,
I got following error.
Sourced file: inline evaluation of: ``getBrowserWidth();'' : Command not found: getBrowserWidth() : at Line: 1 : in file: inline evaluation of: ``getBrowserWidth();'' : getBrowserWidth ( )
I tried your example code. that works for me. thanks for quick resposne.
Regards,
Dhana
Asked: 2009-04-24 04:55:16 +0800
Seen: 193 times
Last updated: Apr 24 '09