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

314
Views
Extracting data from multipart/x-mixed-replace content-type

If I do have the velow html5 element:

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

And my server is returning a counter, I can listen to this counter, and display it at the above element as:

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

But what if the server is sending me a multipart/x-mixed-replace, how can I receive it in the JavaScript code, and display its content in a div or 'objector evenimage`, the server is expected to send me multiple images that can be displayed as video streaming.

I saw this but could not understand how to do it in JavaScript at browser.

Pure JavaScript please.

Note: I was able to do it as:

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

But I prefer using SSE (Server-Sent-Event) to do it.

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!