Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const connection = new signalR.HubConnectionBuilder()
- .withUrl("/notify")
- .build();
- connection.on("notifyclient", (id,eventtype,subject,eventtime,content) => {
- var json = JSON.parse(content);
- const encodedMsg = "<strong>{" + "Notification Id: " + json.id + ",Message: " + json.subject + ",Uri: " + json.data.ItemUri + "}</strong>";
- var div = document.createElement("div");
- var attrib = div.setAttribute("class","alert alert-success");
- //attrib.value = "alert alert-success";
- var div_1 = document.createElement("div");
- var attrib_1 = div_1.setAttribute("id","messageList");
- //attrib_1.value = "messageList";
- div_1.innerHTML = encodedMsg;
- div.appendChild(div_1);
- //li.textContent = encodedMsg;
- document.getElementById("tbrow").appendChild(div);
- });
- connection.start().catch(err => console.error(err.toString()));
Add Comment
Please, Sign In to add comment