Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

320
Views
error de javascript websocket, quiero obtener event.data en alcance global

Quiero extraer datos en tiempo real de binance websocket. pero error de resultado.

 let socket = new WebSocket("wss://stream.binance.com:9443/ws/btcusdt@trade"); socket.onmessage = function(event){ let current_price = JSON.parse(event.data); // console.log(current_price); :is okay! return current_price; } let Data = socket.onmessage(); console.log(Data); :not okay..

even.data en el alcance de la función no tiene ningún error,
pero event.data que no está en el alcance de la función tiene este error.
TypeError no capturado: no se pueden leer las propiedades de undefined (leyendo 'datos')

Quiero obtener even.data en el ámbito global.

por favor ayuda

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!