报错页面
<script type="text/javascript" src="../js/ajaxfileupload.js"></script>
<script type="text/javascript">
function ajaxFileUpload1(fileName) {
$("#some").remove();
if(!/.(gif|jpg|jpeg|png|GIF|JPG|png)$/.test(fileName)){
clearFile();
}else{
$.ajaxFileUpload
(
{
url: 'xxx',
secureuri: false,
fileElementId: 'file',
dataType: 'json',
success: function (data, status)
{
if(data.indexOf(".")>-1){
$("#glogo").css("display","none");
$("#glogo").attr("src","<%=basePath%>tempFile/"+data);
var img=document.getElementById("glogo");
if(img.width>100 && img.height>100){
$("#glogo").css("display","inline");
}else{
clearFile();
}
}else{
alert(data);
clearFile();
}
},
error: function (data, status, e)//服务器响应失败处理函数
{
alert(e);
}
}
)
}
}
</script>
错误:$.ajaxFileUpload Uncaught TypeError: undefined is not a function
成功页面
<script type="text/javascript" src="../js/ajaxfileupload.js"></script>
<script type="text/javascript">
function ajaxFileUpload1(fileName) {
$("#content").remove();
if(!/.(gif|jpg|jpeg|png|GIF|JPG|png)$/.test(fileName)){
clearFile();
}else{
$.ajaxFileUpload
(
{
url: 'xxx',
secureuri: false,
fileElementId: 'file',
dataType: 'json',
success: function (data, status)
{
if(data.indexOf(".")>-1){
$("#glogo").css("display","none");
$("#glogo").attr("src","<%=basePath%>tempFile/"+data);
var img=document.getElementById("glogo");
if(img.width>100 && img.height>100){
$("#glogo").css("display","inline");
}else{
clearFile();
}
}else{
alert(data);
clearFile();
}
},
error: function (data, status, e)//服务器响应失败处理函数
{
alert(e);
}
}
)
}
}
</script>
我用$.post时有时也会有这样的情况这是为什么?
------解决思路----------------------
undefined is not a function
undefined 不是一个函数,调试看看你
------解决思路----------------------
我也是,报错:Uncaught TypeError: $.ajaxFileUpload is not a function
按照网上的方法,还是没解决
http://chen-h.iteye.com/blog/1769457 参考