日期:2014-05-16  浏览次数:20602 次

jquery ajax方法使用

?$(document).ready(function(){
??? ??? ???
?????
??????? $("#submit1").click(function(){

??????? ??? var content = new Array();
??????? ??? var oEditor = FCKeditorAPI.GetInstance("content");
??????? ???
??????? ??? content[0] = oEditor.GetXHTML(true);
??????? ??? content[1] = $("#title").val();
??????? ??? content[2] = $("#part").val();
??????? ??? content[3] = $("#source").val();
??????? ??? content[4] = $("#address").val();
??????? ??? content[5] = $("#author").val();
??? ??? ???? alert( content[0]);
??? ??? ??? ??? var param="";
??? ??? ??? ??? //var flag = "insert";
??? ??? ??? ??? var actions="/rhcy/ContentServelt?flag=insert";
??? ??? ??? ??? ?$.ajax({
??????? ??? ? ??? ?url : actions,
???????? ??? ???? ?data :{content:content},
???????? ??? ? ??? type : 'POST',
????????? ??? ??? ?dataType : 'json',
?????????? ??? success : function(data) {
?????????? }
????? });
?????
?????
??????? });
??? ???
??????? })


servlet中用String [] arr = request.getParameterValues("content");得到内容