sabo66

sabo66

Avoid "tab effect browser reloading" with live navigate?

Hello, I’m starting with Phoenix and live navigation, it is possible to avoid the “reload effect” of the tab browser ? Like on Twitter for exemple, or I need to use some AJAX ?

Marked As Solved

sabo66

sabo66

It was indeed a Javascript problem, app.js was not loaded correctly :slight_smile:

Also Liked

sodapopcan

sodapopcan

Ah yes, if you are going to be navigating from a controller to a LiveView then you’re going to get the reload. There is no simple way around that that I know of. I think using AJAX would even be complicated based on how LiveView works (it first makes an HTTP request then upgrades to a websocket). I think your best bet would be to make UserController a LiveView and stick it under the live_session. That’s the extent of what I know unless anyone else can chime in. Sorry I couldn’t be of more help!

sodapopcan

sodapopcan

You mean tab navigation? (sorry, I don’t know Twitter very well).

Take a look at live navigation in the guides as well as the docs for push_patch/2.

live_session/3 might also be of interest. If not now it will be soon enough!

sodapopcan

sodapopcan

If you are navigating within the same LiveView then you can use <.link patch={~p"/route"}>...</.link>. If you are navigating to a different LiveView that is under the same live session, then you use <.link redirect={~p"/route"}>...</.link> which will happen in the same websocket connection and the browser won’t reload.

Where Next?

Popular in Questions Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

Other popular topics Top

9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New

Latest on Elixir Forum

We're in Beta

About us Mission Statement