我想jQuery的主頁Tutorials頁面將是一個良好的開端:)
簡單的例子來刪除您點擊一個鏈接如下:
<html>
<head>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
<script type="text/javascript">
// execute script only when DOM has finished loading
$(document).ready(function() {
$('#removeme').click(function() {
// remove element that has been target of the event
$(this).remove();
// stop browser from following the link
return false;
});
});
</script>
</head>
<body>
<p>
<a id="removeme" href="http://example.org">Remove me</a>
</p>
</body>
</html>
試試這個:HTTP:// railscasts.com/episodes/205-unobtrusive-javascript – Rahul 2011-08-25 11:44:29