are you using jquery and prototype on the same page by any chance?
If so, use jquery noConflict mode, otherwise you are overwriting prototypes $ function.
noConflict mode is activated by doing the following:
<script src="jquery.js"></script>
<script>jQuery.noConflict();</script>
Note: by doing this, the dollar sign variable no longer represents the jQuery object. To keep from rewriting all your jQuery code, you can use this little trick to create a dollar sign scope for jQuery:
jQuery(function ($) {
// The dollar sign will equal jQuery in this scope
});
// Out here, the dollar sign still equals Prototype
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…