Skip to main content
tags editadas
Link
stderr
  • 30,9mil
  • 5
  • 49
  • 76
removeu 29 caracteres do conteúdo
Fonte Link
stderr
  • 30,9mil
  • 5
  • 49
  • 76

Uncaught InvalidStateError: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.(index):29 (anonymous function)

Uncaught InvalidStateError: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.(index):29 (anonymous function) Código:

function smConnect() {
    ws = new WebSocket('ws://127.0.0.1:1805/');
    delete ws.URL;

    ws.onopen = function(response) {
 
    };

    ws.onmessage = function(response) {
     };

    ws.onclose = function(response) {
  
    };

    ws.onerror = function(error) {
 
    };
    }

    smConnect();
    ws.send('message', 'hi');

O que pode ser?

Uncaught InvalidStateError: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.(index):29 (anonymous function)

function smConnect() {
    ws = new WebSocket('ws://127.0.0.1:1805/');
    delete ws.URL;

    ws.onopen = function(response) {
 
    };

    ws.onmessage = function(response) {
     };

    ws.onclose = function(response) {
  
    };

    ws.onerror = function(error) {
 
    };
    }

    smConnect();
    ws.send('message', 'hi');

O que pode ser?

Uncaught InvalidStateError: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.(index):29 (anonymous function)

Código:

function smConnect() {
    ws = new WebSocket('ws://127.0.0.1:1805/');
    delete ws.URL;

    ws.onopen = function(response) {
    };

    ws.onmessage = function(response) {
    };

    ws.onclose = function(response) {
    };

    ws.onerror = function(error) {
    };
}

smConnect();
ws.send('message', 'hi');

O que pode ser?

Fonte Link
Vinícius Lara
  • 3,8mil
  • 3
  • 29
  • 64

Uncaught InvalidStateError: Failed to execute 'send' on 'WebSocket'

Uncaught InvalidStateError: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.(index):29 (anonymous function)

function smConnect() {
    ws = new WebSocket('ws://127.0.0.1:1805/');
    delete ws.URL;

    ws.onopen = function(response) {
 
    };

    ws.onmessage = function(response) {
     };

    ws.onclose = function(response) {
  
    };

    ws.onerror = function(error) {
 
    };
    }

    smConnect();
    ws.send('message', 'hi');

O que pode ser?