ajax + springmvc如何实现C与观点之间的数据交流方法

  介绍

这篇文章主要介绍ajax + springmvc如何实现C与观点之间的数据交流方法,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!

jQuery。post (url,(数据),(回调),[型])

url,(数据),(回调),[型]字符串,地图,函数,StringV1.0url:发送请求地址。

<强>数据:待发送键/值参数。

<强>回调:强发送成功时回调函数。

<>强类型:强返回内容格式、xml、html、脚本,json,文本,_default .

<强>套用格式:

$ . post (“test.php",,功能(数据){   警报才能(“Data 加载:,“,+,数据);   ,});      $ . get(“评论/getComments ? parentId=? parentId +“, topicId=? topicId功能(数据){   ,var  appendButton =?”;   ,var  append =,““   ,如果(数据!=啊?{   var 才能;arr =, data.split(“美元“);   var 才能;allTr=啊?   ,,(var 小姐:=,0;i & lt; tr> & lt; td>“+内容+“& lt;/td> & lt;/tr> & lt; tr> & lt; td>“+时间+“& lt;/td> & lt;/tr> & lt;/table>“;   appendButton 才能=,appendButton +表+“& lt; button  type =, & # 39;按钮# 39;,id =, & # 39; toAddCommentId& # 39;, onclick =, & # 39; replaceFrom (“+ parentId +“, \““+名称+“\”;“+“)& # 39;在回复& lt;/button>“;   ,,}   appendButton 才能=,appendButton +“& lt; button  type =, & # 39;按钮# 39;,onclick =, & # 39; replaceFrom (“+ parentId +“,“+“\”;“+用户名+“\”;“+“)& # 39;在我也说一句& lt;/button>“;   ,}=,,appendButton  appendButton +“& lt; div  id =, & # 39; commentButton& # 39;,祝辞& lt;/div> & lt; div  id =, & # 39; textareaId& # 39;祝辞& lt;/div>“;   ,如果(data=https://www.yisu.com/zixun/=" ") {   appendButton=appendButton +“