function updateChatroom() {
$.ajax({
url:'../inc/chatroom_update.php',
type:'POST',
success:function(response)
{
$("#chatUpdate").html(response);
}
});
}
I have this ajax above, which is placed in my includes file under header.php. Now my header.php is included in all my website pages which means the url in my ajax needs to change since my web pages can be in different folders. How do I make the AJAX url dynamic?
In PHP terms, if i wanted to make a link dynamic on my header.php file links. I would set a BASE_URL then put in where the file is located. How do I do this from PHP to AJAX? Thanks in advance!