I have a controller function that is posted by ajax call:
func AddLike(w http.ResponseWriter, r *http.Request) {
fmt.Println("form posted
")
// Get session
sess := session.Instance(r)
var params httprouter.Params
params = context.Get(r, "params").(httprouter.Params)
Name := params.ByName("name")
//do stuff
//How to return to calling page?
}
This controller can be posted from several differnet urls.
In the current situation, I see a blank page as the function returns to the url of ajax post, which is /addlike
.
I'm wondering how to return/redirect to the calling page after post being processed?