2012-09-04 45 views
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> 
+2

**決不* *直接鏈接到GitHub文件;它不是CDN。您可以自行託管文件,將其上傳到您自己的CDN或在現有的CDN上找到它。 – Bojangles

+0

你使用任何種類的noconflict()? –

+0

您正在加載嗎?任何在JS控制檯? –

回答

2

對於那些誰也會面臨同樣的問題,這個問題是由於這樣的:道路是不正確的,我必須從服務器下載這樣的路徑是

$.fileDownload('http://localhost:8080/path/to/file'); 

$.fileDownload('C:\\Users\path\to\file');