1. 1.
Kopieren Sie den Code -Code wie folgt:
<html>
<kopf>
<script type = "text/javaScript">
// von go_rush (wulin.com) von //www.vevb.com/
var haben = {{
"Baidu": "http://www.baidu.com/",
"Google": "http://www.google.com/" ,, "
"Microsoft": "http://www.microsoft.com/",
"Wulin.com": "// www.vevb.com/"
};
Funktion Showurl (Element) {// Harbin -Objekt verwenden
ALERT (Hash [Element.Value])
}
</script>
</head>
<body>
<form>
<Eingabe type = "text" id = "txt" />
<input type = "button" value = "test" onclick = "showUrl (document.getElementById ('txt');"/>
</form>
</body>
</html>
2.
Kopieren Sie den Code -Code wie folgt:
<Script>
var ht =
{{{{
"C1": {"userId": "userc1", "Benutzername": "Usercc1"},
"C2": {"userId": "userc2", "Benutzername": "Usercc2"},
"C3": {"userId": "Userc3", "Benutzername": "Usercc3"}
};
alert (ht [c1 "] [" userId "];
alert (ht [c2 "] [" userId "];
</script>
3
Kopieren Sie den Code -Code wie folgt:
<Script>
Var arr = neu Array
alarm (arr [0] .s);
Alert (arr [0] .AA);
Alarm (arr [1] .S1);
Alarm (arr [1] .AA1);
</script>