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

85
Views
Html with script knockout data binding

I am trying to bind html containing some script tags using knockout html binding. I am running into a timing issue.

Knockout observable variable

public customHtml: KnockoutObservable<string> = ko.observable<string>();

Html

<div id="customHtml" data-bind="html: customHtml"></div>

Script in Html causing issue

<script type="text/javascript" src="https://s7d1.scene7.com/s7viewers/html5/js/VideoViewer.js"></script>
<script type="text/javascript"> 
  //var s7videoviewer = new s7viewers.VideoViewer();
  if(typeof s7viewers !== 'undefined'){
    alert('No timing issue');
  }else{
    alert('Timing issue');
    }
</script>

Script works correctly with a delay

<script type="text/javascript"> 
  //var s7videoviewer = new s7viewers.VideoViewer();
  setTimeout(function(){
      if(typeof s7viewers !== 'undefined'){
        alert('No timing issue');
      }else{
        alert('Timing issue');
        }
   }, 3000);
</script>
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!