JSP怎么获取浏览器宽度?

JSP怎么获取浏览器宽度?注意,是JSP,不是JS

jsp获取浏览器宽度是通过js来实现的。
JS 获取浏览器窗口大小

// 获取窗口宽度
if (windows.innerWidth)
winWidth = windows.innerWidth;
else if ((document.body) && (document.body.clientWidth))
winWidth = document.body.clientWidth;
// 获取窗口高度
if (windows.innerHeight)
winHeight = windows.innerHeight;
else if ((document.body) && (document.body.clientHeight))
winHeight = document.body.clientHeight;
// 通过深入 Document 内部对 body 进行检测,获取窗口大小
if (document.documentElement && document.documentElement.clientHeight && document.documentElement.clientWidth)
{
winHeight = document.documentElement.clientHeight;
winWidth = document.documentElement.clientWidth;
}
温馨提示:答案为网友推荐,仅供参考