So i have a chatroom site built with php and jquery but it is using 2 different versions of jquery and some of the new pages i have added conflict with each other (even though i had both jquery versions linked at the same time on the other pages) so i need help converting the code over for i do not know what is depreciated and what is not here is my jquery 1.3 code
// jQuery Document
$(document).ready(function() {
//If user submits the form
$("#submitmsg").click(function() {
var clientmsg = $("#usermsg").val();
$.post("/chatPost/defaultchatpost.php", {
text: clientmsg
});
$("#usermsg").attr("value", "");
return false;
});
//Load the file containing the chat log
function loadLog() {
var oldscrollHeight = $("#chatbox").attr("scrollHeight") - 20;
$.ajax({
url: "/chatLogs/defaultchatlog.html",
cache: false,
success: function(html) {
$("#chatbox").html(html); //Insert chat log into the #chatbox div
var newscrollHeight = $("#chatbox").attr("scrollHeight") - 20;
if (newscrollHeight > oldscrollHeight) {
$("#chatbox").animate({
scrollTop: newscrollHeight
}, 'normal'); //Autoscroll to bottom of div
}
},
});
}
setInterval(loadLog, 500); //Reload file every 2.5 seconds
//If user wants to end session
$("#exit").click(function() {
var exit = confirm("Are you sure you want to end the session?");
if (exit == true) {
window.location = 'defaultchat.php?logout=true';
}
});
});
can someone please help me it would be greatly appreciated i have tried to figure this out for a long time