会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
回头再说 坚强2002的博客
在每个新的一年三百六十五天 我们都每天进步一点点......
博客园
首页
联系
订阅
管理
Prototype实战教程----14.Hash
<
script
src
="prototype.js"
></
script
>
<
script
>
//
创建一个对象
var
obj
=
{
key1:
1
,
key2:
2
,
key3:
3
}
;
//
将其转换为Hash对象
var
hash
=
$H(obj);
//
输出 #<Hash: {'key1': 1, 'key2' : 2, 'key3': 3}>
//
输出key1=1&key2=2&key3=3
alert(
"
hash.inspect()
"
+
hash.inspect()
+
"
\r\ntoQueryString:
"
+
hash.toQueryString()
+
"
\r\n
"
+
"
values:
"
+
hash.values()
+
"
\r\n keys:
"
+
hash.keys());
</
script
>
Share
|
发表于
2007-04-23 12:56
坚强2002
阅读(
1366
) 评论(
0
)
收藏
举报
刷新页面
返回顶部
公告
我,技术人,身体变胖,头脑依然灵活,喜欢Erlang .net,非著名技术博客,翻译过大师经典文章,也原创了不少.在技术之路上沉思,不断重构着不太优秀的自己.爱生活,爱Erlang!