JSCP sample - handle data before rendering

render with remote data 1, change birth date format before rendering, click here to see
render with remote data 2, change birth date format before rendering, click here to see
Comment

Jscp.Updater.update() allows you do something after the data got and before being rendered with page template. You need add a onFinish member in the last option parameter, which should would be a function and be called when data come. You may also add callContext member, which would be hold and return in onFinish function. In this sample, we remember the request start time, when data come, we calculate the total request seconds. And more, we process the data, change the people's birthday display format. After done, you return new render data in your onFinish function, Jscp use this new data to render, if return null, Jscp stops rendering.
Read this sample's HTML source for full details.

NOTE

Template files and return data should be UTF-8 encoding, if they contain non-ASCII characters.