Jump to content
jdauthre

displaying text using javascript & innerHTML

Recommended Posts

I am pretty new to javascript and node.js. I am wanting to display  some text using

document.getElementById('txt').innerHTML= "some text"

followed by a node module :     

var spawn = require('child_process').spawnSync;
      child = spawn('ffmpeg',['-y  -i ',some_file , result_file ], { shell: true });  (which takes some time)

and then  

document.getElementById('txt').innerHTML= "some other text";

However it only disp[ays the second lot of text after the external program has finished. I had assumed that as I am using the synchronous version of spawn that the first line would get displayed first, how can I do this?

Thanks

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...