How to follow link with JavaScript?
I am writing ajax code in Rails. 

What I want to do is:
When user click a button, request is sent to server, data is changed and server returns JavaScript. It shows alert message and go to next page.

Currently server returns JavaScript like this:

``` javascript
alert('Changed successfully.');
// $('#next-link').click(); // Not work
$('#next-link').trigger('touchend'); // Not work either (Nothing happen. No error.)
```

`$('#next-link')` returns link like this: `[<a href="/next_page" id="next-link">Next</a>]`

How can I follow link with JS?
