使用jquery的ajax方法可以异步提交表单,成功后后台返回json数据,回调函数处理,可以不用刷新页面,达到异步的目的: 处理表单的数据可以用serialize()方法进行序列化,而如果提交的数据包括文件流的话,就需要使用 FormData对象: 不带文件的表单数据使用:var data = $(form).serialize(); 带文件的表单数据使用: var data = new FormData($(form)[0]); 一.不上传文件的ajax提交数据: 1.用seriali
MIME (Multipurpose Internet Mail Extensions) 是描述内容类型的互联网标准.Clients use this content type or media type header to select an appropriate viewer application for the type of data the header indicates. 数据接收方根据MIME type of content进行不同的解析. MIME 消息包含文本(text