Page layout see picture
Now is there any way in the form submit, within ifram mentioned the returned JSON as a result, the formatting to it after the show on the right side,
CodePudding user response:
One way is by don't let the background/XXX xx returns json data, but to direct return a formatted HTML page in the background to update the pages in the ifram,Scheme two is not the form submission, but with the ajax request background/XXX xx returns json data, in front of js formatted into the HTML code you need, use js dynamic update ifram the content of the page,
CodePudding user response:
Plan a, let the background to launch a formatted JSON, the background can't use, so plan a, no feasibilityScheme 2, is there any information in detail
CodePudding user response:
Refer to https://www.cnblogs.com/xiao987334176/p/11359130.htmlCodePudding user response:
What's this page, the DEMO is not run upCodePudding user response:
Such as the background the returned json is
{" name ":" zhang ", "phone" : "13643666432"},
{" name ":" bill ", "phone" : "13668745577"},
{" name ":" detective ", "phone" : "13668454542"}
]
HTML code
<meta charset="utf-8"/& gt;
<meta name="viewport" content="width=device - width, initial - scale=1.0" & gt;
<meta HTTP - equiv="X - UA - Compatible" content="IE=edge, chrome=1"/& gt;
<body>
Var data=https://bbs.csdn.net/topics/$(" # formId "). The serialize ();
$. Ajax ({
Url: "request background address,"
Type: "POST",
Data: data,
DataType: "json",
Success: the function (data) {
Var STR='& lt; Table> ';
For (var I=0; i
}
STR +='& lt;/table> ';
$(" # box "). The HTML (STR);
}
});
}
</script>