그래서 chatbox 사이트 php 및 jquery 함께 만들었지 만 jquery 다른 두 가지 버전의 새 페이지 중 일부를 사용하여 서로 충돌을 추가했습니다 (나는 다른 페이지에 동시에 연결 두 JQuery와 버전을했다하더라도) 그래서 내가 감가 상각 모르는에 대한 이상 코드를 변환하는 데 도움이 필요하고 무엇을하지 여기 나의 JQuery와 1.3 코드jquery 2.2.2 내 jquery 1.3 코드를 변환하는 데 도움이 필요
// 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';
}
});
});
입니다
누군가 나를 크게 도와 주시면 감사하겠습니다. 오랫동안 이것을 알아 내려고 노력했습니다.
는 지금까지의 내가 볼 수있는 그 jQuery를에 일을해야 main.html, 당신은 오류가 점점 도움이되기를 바랍니다? 그렇다면 무엇입니까? –
jquery 2.2.2로 아무 것도하지 않는다는 것을 모릅니다. –
많은 기능이없는 문서를 확인하십시오. – scrappedcola