내가signalR은 - 클라이언트에서 서버 메소드 호출하는 방법 - 코드 내가 클라이언트에서 서버 측에서 SendNewOrderConfirmation를 호출 할 때
"정의되지 않은"얻을 작동하지를 함수
에없는 line chat.SendNewOrderConfirmation(data);
왜 이런 일이 일어나는 지 아시나요? 당신은 허브의 자바 스크립트 생성 된 파일을 등록해야
function begin(args) {
try {
//alert('begin');
chat = $.connection.driverChat;
chat.refresh = function() {
ready++;
};
chat.disconnect = function() {
alert('Server has disconnected');
};
$.connection.hub.start(function() {
chat.start(args);
ready++;
// alert('signalR started');
});
} catch (e) {
alert(e.message);
return e.message;
}
}
function confirmNewOrder(data) {
try{
alert('sending cofirmation');
chat.SendNewOrderConfirmation(data);
alert('confirmation sent');
} catch (e) {
alert(e);
}
};
}
생성 된 허브의 자바 스크립트를 등록하셨습니까? –
안녕하세요, 스티브, 어떻게 등록합니까? 몇 가지 코드를 붙여주십시오. 감사합니다 – Ryan