I'm implementing a web application on Spring boot, in the back-end I need to implement RESTful API, and in the front-end I need to consume it using jQuery (unfortunately).
My main screen (index.html) is just a Persons list screen: list of people names, each of them is clickable. When the users click the name of any person in the list, Person Edit form should be provided (filled with the given person's data).
I was thinking my API shouldn't care about the redirecting thing, that's why I wrote this in my controller:

```
@GetMapping("/person/{id}")
public Person findById(@PathVariable String id) {
    Long personId = Long.parseLong(id);
    return personRepository.findOne(personId);
}

```

And in the front-end I'm trying to make an AJAX call to this endpoint, but I can't understand where do I do the redirecting part.
I've tried something like this:

```
$.ajax({
    type: 'GET',
    url: 'http://localhost:8080/api/person/' + id,
    dataType: "json",
    success: function (data) {
        window.location.href = "personForm.html";
        $('#myDiv').append(data.title);          
    }
});

```

but everything after `window.location.href = "personForm.html"` just doesn't happen. Besides using `window.location.href`seems an ugly solution. Any ideas?
Thanks