creates an HTML fragment from a JSON object