今天我找到一个使用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