2015-10-30 50 views
1

我在我的佈局頁面中包含了jquery.1.9.1。對象不支持屬性或方法'jSignature

我正在使用kendo與twitter bootstrap,所以我按照下面的腳本引用順序。

<head> 
<meta charset="utf-8" /> 
<meta name="viewport" content="width=device-width" /> 
<title>@ViewBag.Title</title> 
@Styles.Render("~/Content/css") 
@Scripts.Render("~/bundles/modernizr") 

    <link href="~/Content/styles/kendo.bootstrap.min.css" rel="stylesheet" /> 
<link href="~/Content/styles/kendo.commonbootstrap.min.css"rel="stylesheet"/> 

@*<link href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700" rel="stylesheet" />*@ 
<link href="~/assets/plugins/jquery-ui/themes/base/minified/jquery-ui.min.css" rel="stylesheet" /> 
<link href="~/assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" /> 
<link href="~/assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" /> 
<link href="~/assets/css/animate.min.css" rel="stylesheet" /> 
<link href="~/assets/css/style.min.css" rel="stylesheet" /> 
<link href="~/assets/css/style-responsive.min.css" rel="stylesheet" /> 
<link href="~/assets/css/theme/default.css" rel="stylesheet" id="theme" /> 

<link href="~/assets/plugins/jquery-jvectormap/jquery-jvectormap-1.2.2.css" rel="stylesheet" /> 
<link href="~/assets/plugins/bootstrap-datepicker/css/datepicker.css" rel="stylesheet" /> 
<link href="~/assets/plugins/bootstrap-datepicker/css/datepicker3.css" rel="stylesheet" /> 
<link href="~/assets/plugins/gritter/css/jquery.gritter.css" rel="stylesheet" /> 


<link href="~/assets/plugins/DataTables/css/data-table.css" rel="stylesheet" /> 
<script src="~/assets/plugins/pace/pace.min.js"></script> 

和佈局我的身體部位,如下

<body> 
@Scripts.Render("~/bundles/jquery") 
@RenderBody() 

@*@Scripts.Render("~/bundles/jquery")*@ 
@RenderSection("scripts", required: false) 

<script src="~/assets/plugins/jquery/jquery-1.9.1.min.js"></script> 
<script src="~/assets/plugins/jquery/jquery-migrate-1.1.0.min.js"></script> 
<script src="~/assets/plugins/jquery-ui/ui/minified/jquery-ui.min.js"></script> 
<script src="~/assets/plugins/bootstrap/js/bootstrap.min.js"></script> 

<script src="~/assets/plugins/slimscroll/jquery.slimscroll.min.js"></script> 
<script src="~/assets/plugins/jquery-cookie/jquery.cookie.js"></script> 

<script src="~/assets/plugins/gritter/js/jquery.gritter.js"></script> 
<script src="~/assets/plugins/flot/jquery.flot.min.js"></script> 
<script src="~/assets/plugins/flot/jquery.flot.time.min.js"></script> 
<script src="~/assets/plugins/flot/jquery.flot.resize.min.js"></script> 
<script src="~/assets/plugins/flot/jquery.flot.pie.min.js"></script> 
<script src="~/assets/plugins/sparkline/jquery.sparkline.js"></script> 
<script src="~/assets/plugins/jquery-jvectormap/jquery-jvectormap-1.2.2.min.js"></script> 
<script src="~/assets/plugins/jquery-jvectormap/jquery-jvectormap-world-mill-en.js"></script> 
<script src="~/assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script> 
<script src="~/assets/js/dashboard.min.js"></script> 
<script src="~/assets/js/apps.min.js"></script> 

<script src="~/assets/plugins/DataTables/js/jquery.dataTables.js"></script> 
<script src="~/assets/js/table-manage-default.demo.min.js"></script> 

<link href="~/Content/styles/kendo.rtl.min.css" rel="stylesheet" /> 
<script src="~/Scripts/js/kendo.all.min.js"></script> 
<script src="~/Scripts/js/kendo.web.min.js"></script> 
<script src="~/Scripts/js/kendo.aspnetmvc.min.js"></script> 
<script src="~/Scripts/js/kendo.timezones.min.js"></script> 
<script src="~/Scripts/js/console.min.js"></script> 
<script src="~/Scripts/js/prettify.min.js"></script> 

整個應用程序工作正常。現在我想用戶Jquery的簽名

<script> 
    $(document).ready(function() { 
     $("#signature").jSignature(); 

    }) 
</script> 

這裏我得到的對象不支持財產或方法'jSignature'

如果我保持低於頭部Jquery參考簽名工作正常,但在IE瀏覽器顯示JavaScript運行時錯誤:Bootstrap的JavaScript需要jQuery版本1.9.1或更高,當我點擊繼續簽名工作正常,但我的應用程序無法正常工作。

<script src="~/assets/plugins/jquery/jquery-1.9.1.min.js"></script> 

即使我已經包括

<script src="~/JSignPlugins/jSignature.min.js"></script> 
<script type="text/javascript" src="~/JSignPlugins/flashcanvas.js"></script> 

回答

0

嘗試使用附帶jSignature 「noconflict」 JS文件:

<script src="~/JSignPlugins/jSignature.min.noconflict.js"></script> 

,而不是

<script src="~/JSignPlugins/jSignature.min.js"></script> 
0

由於取自jSignature網站(http://willowsystems.github.io/jSignature/#/about/),你應該具備以下條件:

<!-- Ensure that the jQuery.js file is loaded BEFORE this --> 
<!--[if lt IE 9]> 
<script type="text/javascript" src="libs/flashcanvas.js"></script> 
<![endif]--> 
<script src="libs/jSignature.min.js"></script> 
<div id="signature"></div> 
<script> 
    $(document).ready(function() { 
     $("#signature").jSignature() 
    }) 
</script> 

的jSignature庫包括3個文件:

  • jSignature.min.js
  • flashcanvas.js
  • flashcanvas.swf

這些文件應該位於項目的同一文件夾中。您不需要參考.swf文件,因爲flashcanvas.js會爲您提供參考。

另外,我建議使用Developer Inspect視圖(右鍵單擊> Inspect)在Google Chrome中嘗試並檢查控制檯日誌中是否有任何錯誤。

與Internet Explorer相同。

我建議編輯你的問題,包括你試過這個版本的瀏覽器?即Google Chrome,IE8,9,10,11?

相關問題