0

我想知道是否有一个函数或类似 php 的东西,<?php echo $_GET['height'];?>但在 HTML 或 javascript 中。我需要它来获取 URL 的变量

4

2 回答 2

0

使用location.search. 它返回整个查询字符串,如果需要,您可以将其拆分。

于 2013-06-23T18:06:34.373 回答
0

Html 是一种标记语言,所以你不能做这样的事情。尝试使用 JavaScript。这是一个例子:

//returns the height of the client
function height(){
   var clientHeight = document.body.clientHeight;
   alert(clientHeight);

}

于 2013-06-23T18:09:26.137 回答