I’m trying to get this sample for AJAX to WCF working, with the following code. When viewed in FF, nothing is displayed, and when viewed in IE, the time is displayed.
I’m using IIS 7, btw.
function getTime() { TimeService.TimeService.GetTimeFormatted('dd-mm-yyyy [hh:mm:ss]', onMethodCompleted, onMethodFailed); } function onMethodCompleted(results) { $get('currentTimeLabel').innerText = results; }
…
I’ve not used MS AJAX, but as far as I can tell,
That right there seems like it’ll run an aync invoke on GetTimeFormatted, and pass the results on to ‘onMethodCompleted’..
Will, for every time it gets invoked, re-invoke the getTime method.. So what you’re doing is starting a loop of asynchronous invokes.
It seems to me (noted that I’ve not used ms ajax..) that you should probably have something more like..
And then invoke the getTime method when you want the results updated.