今天我找到一個使用jQuery的方法:live,我寫一個例子來試試它。 我用的是例如,從api.jquery.com,而是通過鍍鉻控制檯,我發現:爲什麼控制檯顯示我jQuery沒有方法'活'
Uncaught TypeError: Object [object Object] has no method 'live'
也許你認爲它是容易的,但對我來說,我不明白this.So我需要搜索引擎後幫助google.help我!
的代碼是這樣的:
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<script src="jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$('body').append('<a href="http://baiud.com" class="sina">yahoo</a>');
$('a.like').live("click", function(){
alert("hello");
return false; }
)
})
</script>
</head>
<body>
<a href="#" class="google">echo hellow</a>
</body>
</html>
而且http://jsfiddle.net/huapei/9C9sF/是我的代碼存在。
怎麼把它沒有辦法住! http://api.jquery.com/live/ – Christoph