2
我進口這個插件的js文件從this site如下 <script type="text/javascript" src="/gestionRH/js/jquery/jqueryFileDownload.js"></script>
然後的jQuery文件下載插件
$.fileDownload('mypath');
螢火蟲表明我這個錯誤:TypeError: $.fileDownload is not a function
鉻表明這一點:未捕獲TypeError: Object function (a,b){return new d.fn.init(a,b,g)} has no method 'fileDownload'
這整個代碼
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript" src="/gestionRH/js/jquery/jquery13_min.js"></script>
</head>
<body>
<input type="button" id="download" value="download">
</body>
<script type="text/javascript">
$("#download").live("click",function(){
$.fileDownload('C:\\Users\\free\\Desktop\\myworkspace\\gestionRH\\WebRoot\\fiches\\note.doc');
});
</script>
</html>
**決不* *直接鏈接到GitHub文件;它不是CDN。您可以自行託管文件,將其上傳到您自己的CDN或在現有的CDN上找到它。 – Bojangles
你使用任何種類的noconflict()? –
您正在加載嗎?任何在JS控制檯? –