예를 들어 this site에서 라이브 웹 채팅 응용 프로그램을 구현하려고합니다. 나는 jquery에 javascript를 처음 사용하기 때문에 예제를 복사하고, 내가 가서 추가 할 때 배울 것이라고 생각했다.잡히지 않은 유형 오류 : 정의되지 않은 함수가 아닙니다.
Uncaught TypeError: undefined is not a function
(anonymous function)
fire jquery-1.8.2.js:974
self.add jquery-1.8.2.js:1018
jQuery.fn.jQuery.ready jquery-1.8.2.js:246
jQuery.fn.jQuery.init jquery-1.8.2.js:174
jQuery jquery-1.8.2.js:44
(anonymous function)
(anonymous function) jquery-1.8.2.js:564
jQuery.extend.globalEval jquery-1.8.2.js:565
(anonymous function) jquery-1.8.2.js:6006
jQuery.extend.each jquery-1.8.2.js:611
jQuery.fn.extend.domManip jquery-1.8.2.js:5991
jQuery.fn.extend.append jquery-1.8.2.js:5764
jQuery.fn.(anonymous function) jquery-1.8.2.js:6186
$.ajax.success jquery.mobile-1.2.0.js:3685
fire jquery-1.8.2.js:974
self.fireWith jquery-1.8.2.js:1082
done jquery-1.8.2.js:7788
callback
내가 오류를 있으리라 믿고있어 함께 할 수있는 뭔가가 :
@{
ViewBag.Title = "OnlineUsers";
}
<html>
<head>
<title>Online Users</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.4/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.4/leaflet.js"></script>
</head>
<body>
<div id="wrapper">
<div id="upperPanel">
<div>
<ul id="messages" itemid="@HttpContext.Current.User.Identity.Name">
</ul>
</div>
<div id="friends">
</div>
</div>
<div id="bottomPanel">
<textarea rows="2" cols="100" id="chatMessage"></textarea>
<input id="chatSubmitMessage" type="submit" value="Send" style="margin-left: 10px;" /><br />
</div>
</div>
<script type="text/javascript">
$(function() {
var pusher = new window.Pusher('0b7eeff567653e170094');
var channel = pusher.subscribe('chat_channel');
channel.bind('message_received', function (data) {
$("#messages").
append('<li>' + data.user + ' ' + data.message + ' ' + data.timestamp + '</li>');
});
$('#chatSubmitMessage').bind('click', function() {
$.post("/", {
chatMessage: $('#chatMessage').val(),
username: $('#messages').attr('itemid')
});
});
});
</script>
</div>
</body>
</html>
이 코드는 나에게 크롬 디버거에서 다음과 같은 오류를 제공합니다 :
이
내가 사용하고있는 코드입니다 기능 이름이없는, 어떤 도움을 크게 주시면 감사하겠습니다.
각 게시물마다 다른 상황에 대한 답변이 있으므로 훈련받은 눈을 가진 사람이 1000 초 이상의 게시물을 탐색하는 것보다 훨씬 빨리 내 오류를 발견 할 수 있다고 생각했습니다. – Matt