首页 新闻 会员 周边 捐助

Uncaught TypeError: $(...).uploadifyUpload is not a function怎么解决

0
[待解决问题]

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" href="right_ht.css">
<link rel="stylesheet" type="text/css" href="../../css/button.css" />
<link rel="stylesheet" type="text/css" href="../../easyui/themes/style.css" />
<link rel="stylesheet" type="text/css" href="../../css/Top.css" />
<link rel="stylesheet" type="text/css" href="../../js/autocomplete/jquery.autocomplete.css" />
<link href="../../js/uploader/uploadify.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../easyui/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="../../js/YMLib.js"></script>
<link rel="stylesheet" type="text/css" href="../../easyui/themes/bootstrap/easyui.css" />
<link rel="stylesheet" type="text/css" href="../../easyui/themes/icon.css" />
<script type="text/javascript" src="../../js/uploader/swfobject.js"></script>
<script type="text/javascript" src="../../js/uploader/jquery.uploadify.v2.1.4.js"></script>
<script type="text/javascript" src="../../easyui/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="../../easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="js/sggl_nc_dl.js"></script>

<body class="easyui-layout" style="height: 98%; width: 98%">

<script type="text/javascript">
$(function(){
$("#kgsj").datebox({
editable:false
});
var date=new Date();
var y = date.getFullYear();
var m = date.getMonth()+1;
var d = date.getDate();
if(m<=9){
m='0'+m;
}
if(d<=9){
d='0'+d;
}
$('#kgsj').datebox('setValue',y+"-"+m+"-"+d);
/* loadUploadify();
fileShow(); */
});
$(document).ready(function() {
$("#uploadSGXK").uploadify({
'uploader' : '../../js/uploader/uploadify.swf',
'script' : '.../../gcgl/uploadJGYSFile.do',
'cancelImg' : '../../js/uploader/cancel.png',
'queueID' : 'fileQueue',
'fileDataName' : 'uploadSGXK',
'auto' : false,
'multi' : false,
'buttonImg': '../../js/uploader/bdll.png',
'simUploadLimit' : 3,
'sizeLimit' : 100000000,
'queueSizeLimit' : 5,
'fileDesc' : '支持格式:xls',
'fileExt' : '',
'height' : 30,
'width' : 92,
'scriptData' : {
'gcgl_jgys.jhid':gcid,
},
onComplete : function(event, queueID, fileObj, response, data) {
alert(response);
fileShow();
},
onError : function(event, queueID, fileObj) {
alert("文件:" + fileObj.name + "上传失败");
},
onCancel : function(event, queueID, fileObj) {
},
onQueueFull : function(event, queueSizeLimit) {
alert("最多支持上传文件数为:" + queueSizeLimit);

}
});
});
$(document).ready(function() {
$("#uploadJGTC").uploadify({
'uploader' : '../../js/uploader/uploadify.swf',
'script' : '../../gcgl/uploadJGYSFile.do',
'cancelImg' : '../../js/uploader/cancel.png',
'queueID' : 'fileQueue1',
'fileDataName' : 'uploadJGTC',
'auto' : false,
'multi' : true,
'buttonImg': '../../js/uploader/bdll.png',
'simUploadLimit' : 3,
'sizeLimit' : 100000000,
'queueSizeLimit' : 5,
'fileDesc' : '支持格式:xls',
'fileExt' : '',
'height' : 30,
'width' : 92,
'scriptData' : {
'gcgl_jgys.jhid':gcid,
},
onComplete : function(event, queueID, fileObj, response, data) {
alert(response);
fileShow();
},
onError : function(event, queueID, fileObj) {
alert("文件:" + fileObj.name + "上传失败");
},
onCancel : function(event, queueID, fileObj) {
},
onQueueFull : function(event, queueSizeLimit) {
alert("最多支持上传文件数为:" + queueSizeLimit);

}
});
});
$(document).ready(function() {
$("#uploadWGYS").uploadify({
'uploader' : '../../js/uploader/uploadify.swf',
'script' : '.../../gcgl/uploadJGYSFile.do',
'cancelImg' : '../../js/uploader/cancel.png',
'queueID' : 'fileQueue2',
'fileDataName' : 'uploadWGYS',
'auto' : false,
'multi' : false,
'buttonImg': '../../js/uploader/bdll.png',
'simUploadLimit' : 3,
'sizeLimit' : 100000000,
'queueSizeLimit' : 5,
'fileDesc' : '支持格式:xls',
'fileExt' : '',
'height' : 30,
'width' : 92,
'scriptData' : {
'gcgl_jgys.jhid':gcid,
},
onComplete : function(event, queueID, fileObj, response, data) {
alert(response);
fileShow();
},
onError : function(event, queueID, fileObj) {
alert("文件:" + fileObj.name + "上传失败");
},
onCancel : function(event, queueID, fileObj) {
},
onQueueFull : function(event, queueSizeLimit) {
alert("最多支持上传文件数为:" + queueSizeLimit);

}
});
});
function fileShow(){
//加载文件
$.ajax({
type:'post',
url:'/hbdtxt/jhgl/queryFjByParentId2.do',
dataType:'json',
data:'uploads.id='+gcid,
success:function(data){
/* var data=datas.rows; */
/* alert(data); */
$("#sgxkTable").empty();
$("#jgtcTable").empty();
$("#wgysTable").empty();
var sgxk="";
var jgtc="";
var wgys="";
for ( var i = 0; i < data.length; i++) {
if(data[i].filetype=="施工许可"){
sgxk += "<tr><td style='background-color: #ffffff; height: 25px;' align='left'>" + data[i].filename +"</td><td style='background-color: #ffffff; height: 25px;' align='left'><a href='javascript:void(0)'style='text-decoration:none;color:#3399CC; ' onclick=downFile('"+data[i].id+"')>下载</a> | <a href='javascript:void(0)'style='text-decoration:none;color:#3399CC; ' onclick=deleteFile('"+data[i].id+"')>删除</a></td></tr>";
}
if(data[i].filetype=="交工通车"){
jgtc += "<tr><td style='background-color: #ffffff; height: 25px;' align='left'>" + data[i].filename +"</td><td style='background-color: #ffffff; height: 25px;' align='left'><a href='javascript:void(0)'style='text-decoration:none;color:#3399CC; ' onclick=downFile('"+data[i].id+"')>下载</a> | <a href='javascript:void(0)'style='text-decoration:none;color:#3399CC; ' onclick=deleteFile('"+data[i].id+"')>删除</a></td></tr>";
}
if(data[i].filetype=="完工验收"){
wgys += "<tr><td style='background-color: #ffffff; height: 25px;' align='left'>" + data[i].filename +"</td><td style='background-color: #ffffff; height: 25px;' align='left'><a href='javascript:void(0)'style='text-decoration:none;color:#3399CC; ' onclick=downFile('"+data[i].id+"')>下载</a> | <a href='javascript:void(0)' style='text-decoration:none;color:#3399CC; ' onclick=deleteFile('"+data[i].id+"')>删除</a></td></tr>";
}
}
$("#sgxkTable").append(sgxk);
$("#jgtcTable").append(jgtc);
$("#wgysTable").append(wgys);
}
});
}
function downFile(id){
parent.window.location.href="/hbdtxt/jhgl/downAbgcFile2.do?uploads.id="+id;
}
function deleteFile(id){
if(confirm('确定删除所选数据?')){
$.ajax({
type : "POST",
url : "/hbdtxt/jhgl/deleteFile2.do",
dataType : 'json',
data : 'uploads.id=' +id,
success : function(msg){
if(msg){
alert('删除成功!');
fileShow();
}else{
YMLib.Tools.Show('删除失败,请选择要删除数据!',3000);
}
},
error : function(){
YMLib.Tools.Show('服务器请求无响应!error code = 404',3000);
}
});
}
}
</script>
</head>
<style type="text/css">
.table_grid tr td input{
width:60px;
}
.table_grid tr td {
border:0.7px solid #E6EEF8;
padding:5px;
}
</style>
<div data-options="region:'center',border:true,split:true">
<form id="kaigong_form">
<div style="align:left;">
<table class="table_grid" cellpadding="0" cellspacing="0" style="width:100%;height:400px;align:left;">
<tr><td align="right" bgcolor="#ebf3ff">实际开工时间:</td>
<td><input type="text" id="kgsj"
name="sggl.kgsj" style="width:180px" value="" /><span style="color:red">&nbsp;&nbsp;*</td>
<td align="right" bgcolor="#ebf3ff">施工单位:</td>
<td><input type="text" id="sgdw" name="sggl.sgdw" style="width:180px;"/></td>
</tr>
<tr><td align="right" bgcolor="#ebf3ff">建设单位:</td>
<td><input type="text" id="jsdw" name="sggl.jsdw" style="width:180px;"/></td>
<td align="right" bgcolor="#ebf3ff">监理单位:</td>
<td><input type="text" id="jldw" name="sggl.jldw" style="width:180px;"></td>
</tr>
<tr><td align="right" bgcolor="ebf3ff">工可批复文号:</td>
<td><input type="text" id="gkpfh" name="sggl.gkpfh" style="width:180px;"/></td>
<td align="right" bgcolor="ebf3ff">施工图批复号:</td>
<td><input type="text" id="sgtpfh" name="sggl.sgtpfh" style="width:180px;"/></td>
</tr>
<tr>
<td style="background-color:#F1F8FF;color: #007DB3; font-weight: bold;width:15%" align="right">交工通车文件:</td>
<td id="td_jgtc" colspan="5" style="background-color: #ffffff; height: 20px;" align="left">
<table style="margin-top:10px;background-color: #aacbf8; font-size: 12px" border="0"
cellpadding="1" cellspacing="1">
<tbody id="jgtcTable"></tbody>
</table>
<table>
<tr>
<td><input type="file" value="选择图片" style="background-image: url('${pageContext.request.contextPath }/js/uploader/bdll.png');" name="uploadSjt" id="uploadJGTC" /></td>
<td><div id="fileQueue1" ></div></td>
</tr>
<tr>
<td rowspan="2">
<img name="uploadFile" id="uploadFile" src="${pageContext.request.contextPath }/js/uploader/upload.png" onclick="javascript:$('#uploadJGTC').uploadifyUpload()" style="border-width:0px;cursor: hand;" />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="background-color:#F1F8FF;color: #007DB3; font-weight: bold;width:15%" align="right">竣工验收文件:</td>
<td id="td_wgys" colspan="5" style="background-color: #ffffff; height: 20px;" align="left">
<table style="margin-top:10px;background-color: #aacbf8; font-size: 12px" border="0"
cellpadding="1" cellspacing="2">
<tbody id="wgysTable"></tbody>
</table>
<table>
<tr>
<td><input type="file" value="选择图片" style="background-image: url('${pageContext.request.contextPath }/js/uploader/bdll.png');" name="uploadSjt" id="uploadWGYS" /></td>
<td><div id="fileQueue2" ></div></td>
</tr>
<tr>
<td rowspan="2">
<img name="uploadFile" id="uploadFile" src="${pageContext.request.contextPath }/js/uploader/upload.png" onclick="$('#uploadWGYS').uploadifyUpload()" style="border-width:0px;cursor: hand;" />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="11" align="center">
<a onclick="savekg()" class="easyui-linkbutton" iconCls="save">保存</a>
<a onclick="closeKg()" class="easyui-linkbutton" iconCls="icon-back">返回</a>
</td>
</tr>
</table>
</div>
</form>
</div>
</body>
</html>

耿直boy的主页 耿直boy | 菜鸟二级 | 园豆:202
提问于:2018-06-07 15:18
< >
分享
所有回答(2)
0

<script type="text/javascript" src="../../easyui/jquery-1.9.1.min.js"></script>

放到

<script type="text/javascript" src="../../js/uploader/jquery.uploadify.v2.1.4.js"></script>

之前

dudu | 园豆:29618 (高人七级) | 2018-06-07 15:41

不行,试过了,还是报那个错误

支持(0) 反对(0) 耿直boy | 园豆:202 (菜鸟二级) | 2018-06-07 15:45

@耿直boy: 浏览器直接方法 jquery.uploadify.v2.1.4.js 能打开吗?

支持(0) 反对(0) dudu | 园豆:29618 (高人七级) | 2018-06-07 15:51

@dudu: 能

支持(0) 反对(0) 耿直boy | 园豆:202 (菜鸟二级) | 2018-06-07 15:55

@耿直boy: 建议试试低版本的jquery,比如 jquery 1.4.2

支持(0) 反对(0) dudu | 园豆:29618 (高人七级) | 2018-06-07 16:22
0

试试,img标签onclick事件改一下 , 触发function,在function里面$('#uploadJGTC').uploadifyUpload()
感觉是页面加载script还没加载完,页面html就已经加载了

、熙和 | 园豆:1508 (小虾三级) | 2018-06-07 18:28
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册