in reply to Mojolicious refresh

Yes there are many different approaches

That's a basic HTML question, which is agnostic of the underlying web framework.

Not sure if mojo offers specialized methods for all.

The classic approach is to reload the page.

Either by specifying

Timtowtdi

I hope this overview will give you a starters to specify what you need and want.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^2: Mojolicious refresh
by jo37 (Curate) on Mar 18, 2020 at 22:10 UTC

    A more advanced technique consists in a client side framework like Angular where the page's content depends on some JS variables and is automatically refreshed whenever a variable's value changes. These changes may be pushed to the client via web sockets. This way page updates are minimal, smooth and happen immediately.

    Implementing this using Mojolicious::Lite on the server side is pretty easy. The real work has to be done on the client.

    Greetings,
    -jo

    $gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$
      > A more advanced technique consists in a client side framework like Angular

      I always thought that the benefit of Web sockets was that the action can be initiated from the server.

      I don't see the big difference to the AJAX/DOM point I listed.

      Or what's the advancement here?

      Speed?

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery

        Avoid polling. Changed content is pushed to the client. This is AJAX based anyway.

        Greetings,
        -jo

        $gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$