Prototype实战教程----4.$H
2022-10-29 16:23:16内容摘要
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html> <head> <title>$H</title
文章正文
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>$H</title>
<script type="text/javascript" language="javascript"
src="prototype.js" ></script>
<script>
function test()
{
// 创建一个对象
var obj = {
key1: 1,
key2: 2,
key3: 3
};
// 将其转换为Hash对象
var hash = $H(obj);
alert(hash.toQueryString());
}
</script>
</head>
<body>
<form>
<input type="button" value="click" onclick="test()" />
</form>
</body>
</html>
本文作者:
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>$H</title>
<script type="text/javascript" language="javascript"
src="prototype.js" ></script>
<script>
function test()
{
// 创建一个对象
var obj = {
key1: 1,
key2: 2,
key3: 3
};
// 将其转换为Hash对象
var hash = $H(obj);
alert(hash.toQueryString());
}
</script>
</head>
<body>
<form>
<input type="button" value="click" onclick="test()" />
</form>
</body>
</html>
本文作者:
代码注释