服务器端获取dom属性(元素的高度)
我想缩放 HTML 页面中所有 HTML 元素的高度。我正在使用 jQuery height() 函数执行此操作,但这需要一些时间并会导致浏览器出现问题。我决定在服务器上执行此操作。我尝试用ajax来做到这一点。但我不能。当我编写 height()
函数时,它不会返回 height()
的值。它只返回 height()
代码。
例如:
我将使用此函数将我的 html 代码发送到服务器
sendHtml('<table><tr><td>'.$variable.'</td></td></table>');
然后我从服务器获取该表格的高度。
还有其他方法可以做到这一点吗?
I want to scale all the HTML element's height in an HTML page. I am doing this with jQuery height() function, but it takes some time and causes problems in the browser. I decided I want to do this at the server. I tried to do this with ajax. But I couldn't. When I write height()
function it doesn't return to me value of height()
. It returns me just height()
code.
For example:
I will send my html code to server with this function
sendHtml('<table><tr><td>'.$variable.'</td></td></table>');
Then i get this table's height from server.
Is there another way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能想查看 Node.js 它是服务器端 JavaScript。
You might want to look into Node.js It's server-side javascript.