87,923
社区成员
发帖
与我相关
我的任务
分享
<a class="current" id='_Menu_120' hidefocus='true' href="javascript:void(0)"><b>文章资讯</b></a>
var arr = new Array();
arr = [];
arr.push([129,"文档编辑","Document/DocList.jsp","Icons/icon003a11.gif"]);
arr.push([303,"文档审核","Document/WorkList.jsp","Icons/icon003a11.gif"]);
arr.push([397,"文档回收站","Document/RecycleBin.jsp","Icons/icon003a11.gif"]);
arr.push([131,"个人备忘","Document/Notes.jsp","Icons/icon003a11.gif"]);
arr.push([132,"短消息","Document/Message.jsp","Icons/icon003a11.gif"]);
$("_Menu_120").ChildArray=arr;
<!DOCTYPE HTML>
<html>
<head>
<meta charset="gb2312" />
<title></title>
<style>
</style>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<div id="test">123</div>
<script>
$("#test").attr('ChildArray','[[129,"文档编辑","Document/DocList.jsp","Icons/icon003a11.gif"],[303,"文档审核","Document/WorkList.jsp","Icons/icon003a11.gif"]]');
var c = $("#test").attr('ChildArray');
var s = eval('('+c+')');
alert(s.length);
</script>
</body>
</html>
arr = [];
arr.push([129,"文档编辑","Document/DocList.jsp","Icons/icon003a11.gif"]);
arr.push([303,"文档审核","Document/WorkList.jsp","Icons/icon003a11.gif"]);
arr.push([397,"文档回收站","Document/RecycleBin.jsp","Icons/icon003a11.gif"]);
arr.push([131,"个人备忘","Document/Notes.jsp","Icons/icon003a11.gif"]);
arr.push([132,"短消息","Document/Message.jsp","Icons/icon003a11.gif"]);
$("#_Menu_120").attr('ChildArray',arr);
var c = $("#_Menu_120").attr('ChildArray');
var s = eval('('+c+')');
alert(s);
<!DOCTYPE HTML>
<html>
<head>
<meta charset="gb2312" />
<title></title>
<style>
</style>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<div id="test" item="['a','b','c','d']"></div>
<script>
var s = $('#test').attr('item');
s = eval('('+s+')');
alert( s[0] )
</script>
</body>
</html>