script src="prototype.js"/scriptscript// 创建一个对象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=3alert("hash.inspect()"+hash.inspect()+"rntoQueryString: "+hash.toQueryString()+"rn"+"values: "+hash.values()+"rn keys: "+hash.keys());/script[ 查看全文 ]