TestJson.
JSP program<% @ page language="Java" contentType="text/HTML. Charset=utf-8 "
PageEncoding="utf-8" % & gt;
<meta HTTP - equiv="content-type" Content="text/HTML. Charset=utf-8 "& gt;
<style type="text/CSS" & gt;
</style>
Var jsonStr=${requestScope. Json}
//the console. The log (' jsonStr='+ jsonStr);
//the console. The log (jsonStr);
The function showDataToDiv (tagId) {
Var div1Node=document. GetElementById (tagId);
for (var i=0; i
Var brNode=document. The createElement method (" br ");
Var br2Node=document. The createElement method (" br ");
InputNode. Type="text";
InputNode. Size=500;
InputNode. [I] value=https://bbs.csdn.net/topics/jsonStr;
Div1Node. The appendChild (inputNode);
Div1Node. The appendChild (brNode);
Div1Node. The appendChild (br2Node);
}
}
Window. The onl oad=function () {
Alert (jsonStr. Length);
ShowDataToDiv (" div1 ");
}
</script>
<body>