whats wrong in this code?
i double checked script src="~/Scripts/jquery.signalR-2.4.0.min.js"> (location),
java script in not working here.using visual studio 2017
help me
@section scripts {
alert("scs");
$(function () {
// Reference the auto-generated proxy for the hub.
var chat = $.connection.chatHub;
// Create a function that the hub can call back to display messages.
chat.client.addNewMessageToPage = function (name, message) {
if (name == "Atir") {
// Add the message to the page.
$('#discussion').append("
"
+ ' ' + htmlEncode(message) + '');
}
else if (name != "Atir") {
// Add the message to the page.
$('#discussion').append("
"
+ ' ' + htmlEncode(message) + '');
}
};
// Get the user name and store it to prepend to messages.
alert("scs");
$('#displayname').val(prompt('Enter your name:', ''));
// Set initial focus to message input box.
$('#message').focus();
// Start the connection.
$.connection.hub.start().done(function () {
$('#sendmessage').click(function () {
// Call the Send method on the hub.
chat.server.send($('#displayname').val(), $('#message').val());
// Clear text box and reset focus for next comment.
$('#message').val('').focus();
});
});
});
// This optional function html-encodes messages for display in the page.
function htmlEncode(value) {
var encodedValue = $('').text(value).html();
return encodedValue;
}
}
div.panel-body {
overflow: scroll;
background: url('C:\Users\ajith\Pictures\yh.jpg');
}
Kalyani ShevalePosted Dec 26, 2018, 6:48 AM