대체 뭐가 문제이지?
본문
제가 친구들이랑 비밀 채팅 사이트를 제작중인데
주기적으로 새로고침을 안하고도 div를 새로고침 할려고 하는데
뭐가 문제일까요?
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, internal-scale=1.0">
<title>채팅</title>
<link href="main.css" rel="stylesheet" type="text/css" media="all"/>
<?php
include './function.php';
?>
</head>
<body>
<header id="header">
<a class="logo" href="index.html">OneChat</a>
</header>
<div id="wrapper1">
<div id="first" class="container">
<div class="title">
<h2>채팅</h2>
</div>
<div id="4" class="content">
<h3><p>
<?php echo read_file('./db'); ?>
</p></h3>
</div>
</div>
</div>
<form method="post" action="system.php" id="chat_form" name="chat_form" autocomplete="off">
<footer id="footer">
<center><table border="0" style="border:none">
<tr>
<td ><input type="text" tabindex="1" id="email" placeholder="입력" class="inputtext radius1" name="사용자" value=""></td>
<td ><input type="submit" tabindex="2" value="전송" class="fbbutton"/></td>
</tr>
</table></center>
</footer>
</form>
</body>
<script>
function autoRefresh_4_div()
{
var currentLocation = window.location;
$("#4").fadeOut('slow').load(currentLocation + ' #4').fadeIn("slow");
}
setInterval('autoRefresh_4_div()', 3000); //3초 후 새로고침
</script>
</html>
답변 3
jquery라는 js파일을 불러 오는 코드가 보이지 않네요.
일단 콘솔에서 에러로그부터 확인해보시기 바랍니다.
해당 소스만으로는 정확한 이유를 알 수가 없습니다.
이게 뭔가요...ㅠㅠ