<html>
<head>
<meta charset=UTF-8>
<title>YuGiOh</title>
<style type="text/css">
</style>
<script type="text/javascript">
var settings = {}
for ( var i = 1 i < 101 i++)
{
settings["nav" + i] = "left" + i
}
alert (settings.nav100)
</script>
</head>
<body>
</body>
</html>
var grid='#id'var Name='cname'
var conf = conf || {}
eval("conf."+Name+" ={List:\""+ grid+"\"}")
属性值加双引号就可以了,如上图