Normally that basic cycle would go:
1. I need to view some data, if I do not already have it, request it.
2. Generate html from data
3. Take generated html and place in appropriate place on page.
This skips step 2 by requesting the required html rather then the raw data. Step 2 is the part that would require the most code.