I am trying to redirect the page on the successful ajax call, the following code works fine,
$.ajax(
{
type: "POST",
url: path,
data: response1,
contentType: "application/json",
success: ->
window.location.replace("http://172.16.17.141:81/configuration/manage_users")
});
Problem with this approach is that the path I am giving is fixed, I want something like,
$.ajax(
{
type: "POST",
url: path,
data: response1,
contentType: "application/json",
success: ->
alert(window.location.host + "/configuration/manage_users")#Gives right path
window.location.replace(window.location.host + "/configuration/manage_users")
#Does not work, I even tried window.location.host.toString()
});
The page does not redirect with the above approach and instead of the URL, the page redirects to "about:blank".
Any help will be appreciated.