的我已經使用3 jQuery的一些相關文件,即jQuery的easeOutBounce功能缺失的,儘管包括jQuery的文件
<script type="text/javascript" src="/blog/jquery/jquery-1.7.1.min.js"></script>
<link type="text/css" href="/blog/css/jquery-ui-1.8.17.custom.css" rel="stylesheet" />
<script type="text/javascript" src="/blog/jquery/jquery-ui-1.8.17.custom.min.js"></script>
我現在想用Humanmsg jQuery插件。它有2 jquery的文件humanmsg.js和的jquery.js。
我已經有最新版本的jquery,所以我沒有從插件中包含jquery.js文件。現在我在Chrome中遇到錯誤未捕獲的TypeError:對象#沒有方法'easeOutBounce'jquery-1.7.1.min.js:4
我已經檢查過這個函數存在於jquery-ui-1.8.17 .custom.min.js但仍然瀏覽器不讀取此文件,儘管顯示錯誤文件jquery-1.7.1.min.js。 雖然插件正在工作,當我替換原始文件jquery-1.7.1.min.js與人工插件腳本文件(jquery.js),但網站的其餘功能取決於orignal腳本文件,所以無法取代它。
任何想法(去除問題)/做法(包括來自第三方的各種腳本文件時要遵循)。 PS:humanmsg.js使用jQuery而不是$(如果它有任何用處)。
所有腳本文件都由瀏覽器完全下載。
下面是代碼:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<script type="text/javascript" src="/var/www/blog/jquery/jquery-1.7.1.min.js"></script> <!--ORIGNAL-->
<link type="text/css" href="/var/www/blog/css/jquery-ui-1.8.17.custom.css" rel="stylesheet" />
<script type="text/javascript" src="/var/www/blog/jquery/jquery-ui-1.8.17.custom.min.js"></script>
<!--script type="text/javascript" src="jquery.js"></script--> <!--Plugin jquery file-->
<script type="text/javascript" src="humanmsg.js"></script>
<link href="humanmsg.css" media="screen" type="text/css" rel="stylesheet">
<title>Humanized Messages - Demo</title>
<script>
jQuery(document).ready(function() {
jQuery('a.showmessage').click(function() {
humanMsg.displayMsg('<strong>Success:</strong> <span class="indent">You clicked \''+jQuery(this).text()+'\'</span>');
return false;
})
jQuery('a.showmessage:last').click(function() {
humanMsg.displayMsg('"Your <strong>Earth</strong> will be reduced to a burned-out cinder."');
return false;
})
})
</script>
</head>
<body>
<p class="links">
<a href="#" class="showmessage">Click Me to show message</a>
</p>
</body>
</html>
編輯:
我發現Gritter,很好的替代了humanmsg及其工作正常使用jQuery的最新版本。
恐怕你說得對。你能建議任何相當於人性化的東西嗎? – Terminal 2012-02-03 17:59:13
@Terminal,我真的不確定你的需求或者這個插件應該做什麼。這只是少量的代碼。逐行瀏覽它,更新它以使用當今版本的jQuery。另請參閱上面關於僅使用單個緩動函數而不使用插件的鏈接......您可以輕鬆地構建一個緩動函數。已經有了 – Sparky 2012-02-03 18:10:41
。謝謝。 – Terminal 2012-02-03 18:13:32