1. 1.
Copier le code du code comme suit:
<html>
<adal>
<script type = "text / javascript">
// par go_rush (wulin.com) de //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/"
};
Fonction showUrl (élément) {// Utilisez l'objet Harbin
Alerte (hash [element.value])
}
</cript>
</ head>
<body>
<Formulaire
<input type = "text" id = "txt" />
<input type = "Button" value = "test" onclick = "showUrl (document.getElementById ('txt'));" />
</ form>
</docy>
</html>
2
Copier le code du code comme suit:
<cript>
var ht =
{{
"C1": {"userId": "user1", "username": "usercc1"},
"C2": {"userId": "user2", "username": "usercc2"},
"C3": {"userId": "user3", "username": "usercc3"}
};
alert (ht [c1 "] [" userId "];
alert (ht [c2 "] [" userId "];
</cript>
3
Copier le code du code comme suit:
<cript>
Var arr = nouveau tableau
alerte (arr [0] .s);
alerte (arr [0] .aa);
alerte (arr [1] .s1);
alerte (arr [1] .aa1);
</cript>