使用jquery.form插件的方法




  
  Document


  
//php后台  
public function get_detail()
  {
    $file = request()->file();
    // dump($file);
    $params   = request()->param();
    // dump($params);
    $result = array('code' => 1);
    return json($result);
  }

一、jQuery.Form.js 配置选项options
选项    说明
url    表单提交数据的地址
type    form提交的方式(method:post/get)
target    服务器返回的响应数据显示在元素(Id)号
beforeSerialize: function($form, options)    表单数据被序列化之前执行的回调函数,如果在内部return false将终止序列化和提交。
beforeSubmit: function(arr, $form, options)    表单数据被序列化成arr数组,并且在提交前触发的回调函数。
error    提交失败执行的回调函数
success    提交成功后执行的回调函数
data    除了表单数据外,还需要额外提交到服务器的数据
iframe    如果有是否应该使用iframe来上传文件(对旧版本浏览器而言)
iframeSrc    为