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

317
Views
Extraer datos de multipart/x-mixed-replace content-type

Si tengo el elemento velow html5:

 <div> Counter: <span id="content"></span> </div>

Y mi servidor está devolviendo un contador, puedo escuchar este contador y mostrarlo en el elemento anterior como:

 var source = new EventSource("http://localhost:8080/counter"); source.onmessage = function (event) { var data = JSON.parse(event.data); document.getElementById("content").innerHTML = counter; }

Pero, ¿qué sucede si el servidor me envía un multipart/x-mixed-replace ? ¿Cómo puedo recibirlo en el código JavaScript y mostrar su contenido en un div u 'objeto or even imagen'? Se espera que el servidor me envíe múltiples imágenes que se pueden mostrar como transmisión de video.

Vi esto pero no pude entender cómo hacerlo en JavaScript en el navegador.

JavaScript puro por favor.

Nota: pude hacerlo como:

 <object data="http://localhost:8080/camera" width="300" height="200" alt="Cam streaming"></object>

Pero prefiero usar SSE (Server-Sent-Event) para hacerlo.

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!