精细上传开箱即用的问题/错误

时间:2013-11-06 07:03:01

标签: php fine-uploader

尝试使用网站上的相同代码立即运行fineuploader。

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Fine Uploader Demo</title>
<link href="custom.fineuploader-4.0.3.css" rel="stylesheet">
</head>
<body>
<div id="fine-uploader"></div>
<script src="custom.fineuploader-4.0.3.js"></script>
<script>
  function createUploader() {
    var uploader = new qq.FineUploader({
      element: document.getElementById('fine-uploader'),
      request: {
        endpoint: 'server/handleUploads'
      }
    });
  }
  window.onload = createUploader;
</script>
</body>
</html>

甚至在开始使用endpoint.php之前,我在浏览器中查看了一下,我在Firebug中遇到以下错误:

ReferenceError: jQuery is not defined
}(jQuery));
custom....0.3.js (line 8012)
Error: Cannot find template script at ID 'qq-template'!
...ew Error(qq.format("Cannot find template script at ID '{}'!", options.templateId...

我错过了什么?

1 个答案:

答案 0 :(得分:0)

您的代码中缺少jQuery库 将此添加到您的头标记

<head>
.
.
.    
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
.
.
</script>
</head>