服务器端获取dom属性(元素的高度)

发布于 2025-01-01 08:37:04 字数 426 浏览 1 评论 0原文

我想缩放 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

二智少女猫性小仙女 2025-01-08 08:37:04

您可能想查看 Node.js 它是服务器端 JavaScript。

You might want to look into Node.js It's server-side javascript.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文