【发布时间】:2014-11-09 19:11:42
【问题描述】:
我在后面的代码中将 Dictonary 公开声明为:
Public dics As New Dictionary(Of String, String()) From { _
{"picture", New String() {".jpeg", ".jpg", ".png", ".bmp", ".gif", ".tif"}}, _
{"document", New String() {".doc", ".docx", ".txt", ".htm", ".html", ".xml", ".xaml", ".css"}}, _
{"excel", New String() {".xls", ".xlsx", ".xlt", ".xla"}}, _
{"pdf", New String() {".pdf"}}, _
{"zip", New String() {".7z", ".APK", ".BAT", ".rar", ".dll", ".jar", ".zip"}}, _
{"ppt", New String() {".ppt", ".pos", ".pps"}}}
编辑:
如果我喜欢这个
function myFunction() {
var dic = "<%= dics %>";
var array_keys = new Array();
var array_values = new Array();
for (var key in dic) {
alert(key);
}
}
将警报显示为
我如何在javascript 中访问这个Dictonary 来做一些操作
【问题讨论】:
-
检查this thread是否给了你尝试的想法
-
如果字典中存储的值是静态的,那么你可以尝试声明包含这些值的js变量。
-
@Priya:这里的值是静态的,不会动态变化
标签: javascript asp.net vb.net dictionary