Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法解决Jquery和Mootools冲突_Jquery_Mootools_Conflict - Fatal编程技术网

无法解决Jquery和Mootools冲突

无法解决Jquery和Mootools冲突,jquery,mootools,conflict,Jquery,Mootools,Conflict,我是一个初学者。。。 我使用了两个Jquery(一个是用于弹出窗口的Jquery(“类似ajax”)来自颜色框,另一个是用于加载更多选项以再次获取数据ajax的Jquery),它与Mootools(用于日历功能)冲突/冲突。 这是我的电话号码 <script type="text/javascript" src="cal/js/mootools-1.2.4-core.js"></script> <script type="text/javascript" src="

我是一个初学者。。。 我使用了两个Jquery(一个是用于弹出窗口的Jquery(“类似ajax”)来自颜色框,另一个是用于加载更多选项以再次获取数据ajax的Jquery),它与Mootools(用于日历功能)冲突/冲突。 这是我的电话号码

<script type="text/javascript" src="cal/js/mootools-1.2.4-core.js"></script>
<script type="text/javascript" src="cal/js/mootools-1.2.4.4-more.js"></script>
<script type="text/javascript" src="cal/js/calendar-eightysix-v1.1.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script>
<script src="javascripts/popup-jquery/jquery.popup.googleapis.js"></script>
<script src="javascripts/popup-jquery/jquery.colorbox.js"></script>
<script type="text/javascript">
    jQuery.noConflict();
    // For jQuery scripts
(function($){   
    $(document).ready(function(){
    //Calling Pop-up 
        $(".example5").colorbox();

        //Calling More Button
        $('.more').live("click",function() 
            {
                var ID = $(this).attr("id");
                if(ID)
                {
                    $("#more"+ID).html('<img src="load/moreajax.gif" />');
                    $.ajax({
                        type: "POST",
                        url: "load/ajax_more_calender_content.php",
                        data: "lastmsg="+ ID, 
                        cache: false,
                        success: function(html){
                            $("div#updates").append(html);
                            $("#more"+ID).remove();
                            }
                        });
                }
                else
                {
                    $(".morebox").html('The End');
            }
        return false;
        });
    });
})(jQuery);


    (function($) {
        window.addEvent('domready', function() {

    //Example XIII
        var calendarXIII = new CalendarEightysix('exampleXIII', { 'injectInsideTarget': true, 'alwaysShow': true,'draggable': true, 'pickable': true });
        calendarXIII.addEvent('rendermonth', function(e) {
            //The event returns all the date related elements within the calendar which can easily be iterated
            e.elements.each(function(day) {
                day.set('title', day.retrieve('date').format('%A %d %B'));




                    day.setStyles({  'cursor': 'pointer' }).addEvent('click', function() { window.location='../calender.php?date='+day.retrieve('date').get('date')+'&month='+day.retrieve('date').get('month')+'&year='+day.retrieve('date').get('year'); } );             
            });
        });
        calendarXIII.render(); //Render again because while initializing and doing the first render it did not have the event set yet

    });
})(document.id);
</script>

jQuery.noConflict();
//对于jQuery脚本
(函数($){
$(文档).ready(函数(){
//呼叫弹出窗口
$(“.example5”).colorbox();
//呼叫更多按钮
$('.more').live(“单击”,函数()
{
var ID=$(this.attr(“ID”);
如果(ID)
{
$(“#更多”+ID).html(“”);
$.ajax({
类型:“POST”,
url:“load/ajax\u more\u calender\u content.php”,
数据:“lastmsg=“+ID,
cache:false,
成功:函数(html){
$(“div#updates”).append(html);
$(“#更多”+ID).remove();
}
});
}
其他的
{
$(“.morebox”).html(“结尾”);
}
返回false;
});
});
})(jQuery);
(函数($){
addEvent('domready',function(){
//例十三
var calendarXIII=new calendar八十六('exampleXIII',{'injectInsideTarget':true,'alwaysShow':true,'Dragable':true,'pickable':true});
calendarXIII.addEvent('rendermonth',函数(e){
//该事件返回日历中所有与日期相关的元素,这些元素可以轻松地进行迭代
e、 元素。每个(功能(天){
day.set('title',day.retrieve('date')。格式('%A%d%B');
day.setStyles({'cursor':'pointer'}).addEvent('click',function(){window.location='../calendar.php?date='+day.retrieve('date').get('date')+'&month='+day.retrieve('date').get('month')+')&year='+day.retrieve('date)).get('year');});
});
});
calendarXIII.render();//再次渲染,因为在初始化和执行第一次渲染时,尚未设置事件
});
})(文件编号);
我在许多论坛上读过,并以上述方式实现了它,工作代码只是弹出并加载更多选项(jQuery),而不是日历(mootools)。 但代码仍然不起作用。。。任何帮助都将是非常值得感激的。。。!!!!
谢谢

您正在修复您的实例化,但是日历选择器插件是否使用了
document.id
$
?此日历脚本的内容类似于
this.target=$(target)
-编辑它并修复到
document.id
,或者像实例化一样放入一个闭包


另外,您应该最后加载mootools及其依赖项-如果在其他地方定义了
$
,它将自动恢复到自v1.2.4以来的
document.id
。你可能还想看看Arian在mootools forge上的DatePicker,它是为mootools 1.3+设计的,并且是以一种不冲突的方式编写的。

我记得我用了类似于
$.jQuery()
的东西来定义选择器,但在这样做之前你应该做一件事,我现在记不起来了,在网上搜索。我认为这是最好的方法,我用MooTools进行了测试,没有任何冲突发生。谢谢你,先生。。。但是jquery正在工作,而Mootools不工作。。。。我尝试了你的建议,但同样的问题仍然让我感到恐慌…在我以前的作品中发现了它。首先,我做了一个
jQuery.noConflict()
接下来我使用
jQuery(“”)
作为选择器。试试这个,报告我!不,先生,它还没开始工作。。。jQuery插件已经开始工作了,是Mootools插件没有工作。。。我认为Mootools的代码有问题。。。这是不工作,所以,我一直保持上述代码只在控制台的Firebug检查。。。它在mootools-1.2.4-core.js中显示错误,并给出无法创建附加子项的错误。。。!!!你对Mootools的工作机制有什么想法吗。。。如果你有请检查我的Mootools代码部分…你有链接吗?或者JS提琴,这样我们可以帮助您正确调试?谢谢您,先生,实际上我是一个初学者。。。我不知道如何编辑你提到的主要代码。target=$(target);。。要记录。id。。。也请帮我。。。?此外,我使用的日历是一个有得到的日期作为链接,通过当前日期到新的页面,根据传递的数据处理数据。。。我找了很多日历找这个,最后我找到了这个日历。。。现在重新开始就像地狱一样。。。。请帮我做这个。。。谢谢你。。。