需要帮助将Jquery转换为Mootools

Gra*_*ham 1 jquery mootools

有人可以帮助我将以下Jquery脚本转换为mootools等效的吗?

我需要使用Mootools来防止我的Joomla网站出现冲突问题.

    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    jQuery(document).ready(function(){
        jQuery('div.rj_insertcode a.glossarylink').each(function() {
            jQuery(this).replaceWith(jQuery(this).html());
        });  
        jQuery('.no_glossary a.glossarylink').each(function() {
            jQuery(this).replaceWith(jQuery(this).html());
        });  
    });     
    </script>
    </head>
Run Code Online (Sandbox Code Playgroud)

或者,如果有人可以推荐如何使上述代码与Mootools兼容(我对两种语言都相当新),我们将不胜感激.

ari*_*ian 5

我不打算直接移植它,但这里是使用方法的MooTools等价物:

  • jQuery(document).ready(fn)window.addEvent('domready', fn)- 在浏览器准备好加载DOM时执行该功能 - docs
  • jQuery(selector)$$(selector)- 返回元素集合 - docs
  • collection.each(fn)collection.each(fn)- 迭代每个元素 - docs
  • jQuery(this).replaceWith(html)this.replaces(element)- 用另一个元素替换元素 - docs

另请参阅我为示例链接的文档.