1. 1.
Copy code code as follows:
<html>
<head>
<script type = "text/javascript">
// by go_rush (Wulin.com) from //www.vevb.com/
var have = {
"Baidu": "http://www.baidu.com/",
"Google": "http://www.google.com/",, "
"Microsoft": "http://www.microsoft.com/",
"Wulin.com": "// www.vevb.com/"
};
Function Showurl (Element) {// Use Harbin Object
Alert (Hash [Element.value])
}
</script>
</head>
<body>
<FORM>
<input type = "text" id = "txt" />
<input type = "Button" value = "Test" OnClick = "Showurl (Document.GetelementByid ('TXT'));"/>
</form>
</body>
</html>
2.
Copy code code as follows:
<script>
var ht =
{{
"C1": {"userid": "userc1", "username": "usercc1"},
"C2": {"userid": "userc2", "username": "usercc2"},
"C3": {"userid": "userc3", "username": "usercc3"}
};
alert (ht [c1 "] [" userid "];
alert (ht [c2 "] [" userid "];
</script>
3
Copy code code as follows:
<script>
Var arr = new array
alert (arr [0] .s);
alert (arr [0] .aa);
alert (arr [1] .s1);
alert (arr [1] .aa1);
</script>