Call the new action from a controller with javascript

If You just want to be redirected, You could use a normal link instead of a js link, passing some parameters along.

The idea of js link is not to have the page reloaded. You make a request, with fetch or ajax, and you receive data. With this data, You still need to update the Dom to reflect changes. This can be done by jquery, or vanilla js.

For your use case, I would look at drab library.

1 Like