问题描述
我想在HTML页面中缩放所有HTML元素的高度。我正在使用jQuery height()函数,但它需要一些时间并在浏览器中导致问题。我决定在服务器上这样做。我试图用ajax这样做。但我不能。当我写 height()
函数时,它不会返回到$ code> height()的值。它返回我只是 height()
代码。
例如:
我将使用此功能将我的html代码发送到服务器
sendHtml('< table>< tr>< td>'$ variable。'< / td>< / td> ; /表>');
然后我从服务器获取此表的高度。
您可能需要查看是服务器端的JavaScript。
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?
You might want to look into Node.js It's server-side javascript.
这篇关于服务器端获取dom属性(元素的高度)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!