Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/393.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/228.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
当我包括<;脚本>;javascript代码不支持的另一个PHP文件中的标记';我不能正常工作_Javascript_Php_Jquery_Html_Ajax - Fatal编程技术网

当我包括<;脚本>;javascript代码不支持的另一个PHP文件中的标记';我不能正常工作

当我包括<;脚本>;javascript代码不支持的另一个PHP文件中的标记';我不能正常工作,javascript,php,jquery,html,ajax,Javascript,Php,Jquery,Html,Ajax,我已经在这个问题上纠缠了一段时间了。也许你们中的一些编程天才可以帮我 因此,我正在处理6个文件: BASE_URL/header.php BASE_URL/footer.php BASE_URL/includes/notifications.php BASE_URL/includes/wall.php BASE_URL/javascript1.js BASE_URL/javascript2.js header.php文件包含javascript1.js的标记 php文件包含javascript2

我已经在这个问题上纠缠了一段时间了。也许你们中的一些编程天才可以帮我

因此,我正在处理6个文件:

  • BASE_URL/header.php
  • BASE_URL/footer.php
  • BASE_URL/includes/notifications.php
  • BASE_URL/includes/wall.php
  • BASE_URL/javascript1.js
  • BASE_URL/javascript2.js

    header.php文件包含javascript1.js的标记

    php文件包含javascript2.js的标记

    php文件获取消息和警报,其中包含一些html,并从wall.php调用函数

    php文件从数据库获取消息,其中包含一些html

    javascript1.js文件有一些ajax引用notifications.php

    javascript2.js文件包含一些javascript

  • 一切正常。除了我的javascript2.js文件中的javascript代码似乎不起作用之外。当我在notifications.php文件中包含标记时,它会导致一些错误,请帮助

    下面是javascript1.js的代码

    /*---------------- popoup message notifications -----------------*/
    jQuery(document).ready(function()
    {/* this function will be available after the document is loaded */
    
        /* declare the message notification variables */
        var messagesIcon    = $('.page_header_messages_icon');
        var messagesInboxList   = $('.messages_popup_box_inbox_list');
    
        /* declare the ajaxAutoAlerts variable */
        var ajaxAutoAlerts;
    
        /* call the autoLoadMessages function */
        autoLoadMessages();
    
        messagesIcon.click(function(event)
        {/* when the messagesIcon is clicked */
    
            /* show the ajax loader */              
            jQuery(messagesInboxList).html("<div class='load_notifications' align='center'><img src='"+site_url+"img/ajax-loader.gif' /></div>"); 
    
            var dataString = 't=alrt';
    
            jQuery.ajax({
                type: "POST",
                url: site_url+"includes/message_notifications.php",
                data: dataString,
                cache: false,
                success: function(response){
    
                    jQuery(messagesInboxList).html("");
                    jQuery(messagesInboxList).html(response);
    
                    /* resize nicescroll everytime an element using nicescroll is shown/hidden */ 
                    niceScrollVariable.getNiceScroll().resize();
                }
            });
        });
    });
    
    /*--------------popoup消息通知-----------------*/
    jQuery(文档).ready(函数()
    {/*加载文档后,此函数将可用*/
    /*声明消息通知变量*/
    var messagesIcon=$('.page_header_messages_icon');
    var messagesInboxList=$('.messages_popup_box_inbox_list');
    /*声明ajaxAutoAlerts变量*/
    var ajaxAutoAlerts;
    /*调用autoadmessages函数*/
    自动留言();
    messagesIcon.click(函数(事件)
    {/*单击消息图标时*/
    /*显示ajax加载程序*/
    jQuery(messagesInboxList).html(“”);
    var dataString='t=alrt';
    jQuery.ajax({
    类型:“POST”,
    url:site_url+“includes/message_notifications.php”,
    数据:dataString,
    cache:false,
    成功:功能(响应){
    jQuery(messagesInboxList).html(“”);
    jQuery(messagesInboxList).html(响应);
    /*每次显示/隐藏使用nicescroll的元素时调整nicescroll的大小*/
    niceScrollVariable.getNiceScroll().resize();
    }
    });
    });
    });
    
    你能告诉我们这些“错误”吗?它似乎干扰了我的其他一些javascript代码。就像当我点击弹出框的图标时,我必须多次点击它。如果
    javascript2.js文件似乎不起作用
    ,那么你应该共享这个文件。你说控制台中出现了一些错误,为了让我们帮助你,我们需要查看这些错误。我甚至没有注意到你没有共享正确的文件,其次@RishiBTW,
    jQuery(messagesInboxList)
    应该是
    messagesInboxList