ajax上传文件附带参数问题之 $(...).dialog is not a function
来源:互联网 发布:网络主播招聘文案 编辑:程序博客网 时间:2024/05/29 07:29
1、先引用两个包
jquery-1.8.0.min.js和ajaxfileupload.js
<script src="${ctx}/js/jquery-1.8.0.min.js" type="text/javascript"></script><script src="${ctx}/js/ajaxfileupload.js" type="text/javascript"></script>
html
<form id="AnchorImportForm" method="post" enctype="multipart/form-data" "><input type="hidden" id="pipeImportId" name="pipeImportId" value="${pipeImportId}"> <div id="file_up" height="100" width="100%" style="margin-top:50px"> <input id="upfile" type="file" name="upfile" accept="xlsx"/></div><p></p><input type="button" value="导入" style="text-align:center;background-color:#d9ffff;border:none;" onClick="File.upLoadFile()"></form>
js
File.upLoadFile=function(){ var id= document.getElementById("pipeImportId").value;$.ajaxFileUpload({ url: '${ctx}/sys/file/upLoadTwo', secureuri:false, fileElementId: 'upfile',//上传文件的id dataType: 'json', data: { "pipeId": id }, success:function(result){ try{if(result.success){$('#dialogDivImport').dialog('close');}$.messager.show({title:'提示',msg:result.msg});}catch(e){$.messager.alert("警告",result.msg);} }});}
报这个错的原因之一就是引用冲突。我这里的
<script src="${ctx}/js/jquery-1.8.0.min.js" type="text/javascript"></script>是冲突的,可能是外部已经引用了,在这里删除就OK了...
0 0
- ajax上传文件附带参数问题之 $(...).dialog is not a function
- $('#dlg').dialog('open') is not a function
- AJAX问题:jQuery.handleError is not a function
- jquery dialog load页面时.dialog is not a function
- fileupload is not a function 上传错误
- jQuery.form Ajax无刷新上传报错 (jQuery.handleError is not a function) 解决办法
- jQuery.form Ajax无刷新上传报错 (jQuery.handleError is not a function) 解决办法
- jquery ajax图片上传 springmvc ajaxFileUpload 报这错jQuery.handleError is not a function
- TypeError: $(...).dialog is not a function debug过程
- $ is not defined $ is not a function 问题
- ajaxfileupload.js上传文件时jQuery.handleError is not a function的 解决办法
- ajaxfileupload上传文件dataType为json时报jQuery.handleError is not a function
- ajax返回String类型导致的flowplayer报错p.replace is not a function问题
- $ is not a function
- $ is not a function
- is not a function
- React Ajax this.IsMounted() is not a function
- Uncaught TypeError: $.ajax(...).error is not a function
- MySQL和Oracle分页的区别
- requirejs初步了解
- unity3d5.4.2f2版本免费下载及安装
- 软件实施提升效率的五个工具
- QTP在EXCEL里面添加超联接的方法(修正)
- ajax上传文件附带参数问题之 $(...).dialog is not a function
- 译码准则
- idea注册码
- birt 的动态sql,即多条件查询
- Delphi判断文件是否正在被使用
- ubuntu 下 Genymotion报Unable to load virtualbox engine错误
- 谈谈Retrofit连接https证书问题
- Android设计模式~~~工厂方法模式
- UMDFaces数据集csv文件处理工具