Why not harvest the power of knockout and let it render the #main div for you, now you mix knockout and jQuery.
I've made a light weight SPA bootstrapper for KO, here is a demo project
https://github.com/AndersMalmgren/Knockout.Bootstrap.Demo
It takes handles the templates for you in convention over configuration way.
edit: Wiki that shows how to set it up on any backend
https://github.com/AndersMalmgren/Knockout.Bootstrap/wiki
Basically you need to expose a REST service that returns the templates