This the html file
I want to catch the object property inside obj and make them a json
string like

'{"div": [{"name": "div1", "w": "100", "h": "100"}, {"name": "div2",
"w": "200", "h": "200" }], "img": [{"name:", "img1", "w": "50", "h":
"50"}]}';

any suggestion to accomplish it?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml";>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>json question</title>
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
</head>

<body>
<div id="obj">
    <img src="1.jpg" width="50" height="50" status="img" id="img1" />
    <div id="div1" status="div" style="width: 100px; height: 100px;"></
div>
    <div id="div2" status="div" style="width: 200px; height: 200px;"></
div>
</div>
</body>
</html>

Reply via email to