sam sam - 3 months ago 34
Ajax Question

Calling HTML function from WCF service

I have a callback in WCF service, which receives the raw frames from the camera. Now I am writing a HTML application that displays these frames.

But, as of now, I use a button click event in HTML to get the current frame from WCF service(using ajax). I would like to get the frames continuously with a single button click event. Any ideas on how to do so?

Thanks in advance.


No, you would need your JavaScript to repeatedly call your web service.

You can't just get a WCF service to return some results, then every few seconds later, return some (updated) results.

//  Call a web service, once every 3 seconds.
setInterval(function() { 
    //  Call your WCF service here
}, 3000);