struts2 ajax

function upload() {
		var fileValue = $.trim($("#file").val());
		var description = $.trim($("#description").val());
		var pageuploadUrl = $.trim($("#pageuploadUrl").val());
		var cfg = {"desc" : description, "webUrl" : pageuploadUrl};
		$.ajax({
    		type : "POST",
		  	url : "/SMS/activepage/addNewActivePage.action",
		  	dataType : "json",
		  	async : false,
		  	contentType : 'application/json;charset=UTF-8',
		  	data : JSON.stringify({"activePage" : cfg}),
		  	success : function(data) {
		  		// var rCode = response.code;
		  		// $("#validate_code").val(rCode);
		  		alert("添加成功");
		  		window.location.href = "./../activepage/getActivePageLimit.action";
		  	}
		});
	}

相关推荐