当前位置:Gxlcms > JavaScript > jquery的ajaxSubmit()异步上传图片并保存表单数据演示代码_jquery

jquery的ajaxSubmit()异步上传图片并保存表单数据演示代码_jquery

时间:2021-07-01 10:21:17 帮助过:7人阅读

(jsp需要引入 :jquery-1.9.0.js、jquery.form.js ) ,jsp页面使用的是bootstrap制作的,看不懂的标签不用管,form表单大同小异。代码比较简陋,只是为了演示使用ajaxSubmit异步上传图片及保存数据,请海含!
(参考文献:http://www.gxlcms.com/shouce/jquery/jquery_api/Plugins/Form/ajaxSubmit.html)
一:web (add.jsp)
代码如下:

<%@page import="com.fingerknow.project.vo.UserInformation"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>





注册商圈








<%
response.setCharacterEncoding("utf-8");//这个是设置编码方式
response.setContentType("text/html");//这个是设置网页类型,为文本代码
UserInformation user=null;
String username="";
Integer userId=null;
if(request.getSession().getAttribute("userinfo")!=null){
user=(UserInformation)request.getSession().getAttribute("userinfo");
username=user.getUsername();
userId=user.getUserId();
}else{
username="请登录";
}
%>


















注册商圈














© 2012 fingerknow.com |隐私条款|服务条款|粤ICP备12003619号-1