I've been stuck on this issue for a while now. Maybe some of you programming geniuses can help me out.
So I am working with 6 files:
- 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
The header.php file includes the tag for javascript1.js.
The footer.php file includes the tag for javascript2.js.
The notifications.php file gets the messages and alerts and has some html in it and calls a function from the wall.php.
The wall.php file gets the messages from the database and has some html in it.
The javascript1.js file has some ajax that refers to the notifications.php
The javascript2.js file has some javascript.
Everything works fine. Except that the javascript code in my javascript2.js file doesn't seem to be working. And when I include the tag within the notifications.php file it causes some errors please help.
Here is the code for the 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();
}
});
});
});