点的转义:. ==>\\u002E
美元符号的转义:$ ==>\\u0024
乘方符号的转义:^ ==>\\u005E
左大括号的转义:{ ==>\\u007B
左方括号的转义:[ ==>\\u005B
左圆括号的转义:( ==>\\u0028
竖线的转义:| ==>\\u007C
右方括号转义:] ==>\\u005D
右圆括号的转义:) ==>\\u0029
星号的转义:* ==>\\u002A
加号的转义:+ ==>\\u002B
问号的转义:? ==>\\u003F
反斜杠的转义:\ ==>\\u005C
json测试文件
{
"first":[
{"name":"001"},
{"name":"002"},
{"name":"003"},
{"name":"004"},
{"name":"005"},
{"name":"006"},
{"name":"007"}
]
}
<!doctype html><html>
<head>
<meta charset="utf-8">
<title>下拉列表</title>
</head>
<body>
<select id="asd">
</select>
<script type="text/javascript" src="jquery-1.11.3.min.js"></script>
<script>
$(function () {
$.ajax({
type:"get",
url:"ceshi.json",
async:true,
dataType:"json",
success:function (data) {
$.each(data.first, function(i,item) {
var sele='<option value="'+item.name+'">'+item.name+'</option>'
$("#asd").append(sele)
})
}
})
})
</script>
</body>
</html>