Use ajax in template