Answer the question
In order to leave comments, you need to log in
Why does such an error pop up?
Hello, here I met with such a Jquery error for node js
TypeError: $.parseJSON is not a function
var WebSocketClient = require('websocket').client;
var $ = require('jquery');
var client = new WebSocketClient();
client.on('connect', function(connection) {
console.log('WebSocket Client Connected');
connection.on('error', function (error) {
console.log("[ERROR]Connection Error: " + error.toString());
});
connection.on('close', function () {
console.log('[WARNING] echo-protocol Connection Closed');
});
connection.on('message', function (message) {
if (message.type === 'utf8') {
console.log("Received: '" + message.utf8Data + "'");
var string = message.utf8Data;
var dannie = $.parseJSON(string);
console.log(dannie.online);
}
});
});
client.connect('ws://node.csgohot.com:8083/', 'echo-protocol');
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question