pillaiindu

pillaiindu

What will be the best practice for doing AHAH in Phoenix?

AHAH means Asynchronous HTML over HTTP.
Replies with code examples will be much appreciated.
Thank you!

Most Liked

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Of the top two google hits for me, http://www.openjs.com/articles/ajax/ahah_asynchronous_html_over_http/ is a 7 year old article, and talks about how ajax returns XML, and http://microformats.org/wiki/rest/ahah references stuff from 2005, so maybe the approach is a little dated?

Conceptually though I think live view might be relevant, in that you just have the server push HTML. Can you elaborate about what you’re trying to actually accomplish though?

mindok

mindok

WebSockets is the default transport for LiveView, but you can configure it for longpolling (I haven’t tried)

And yes, either LiveView (Phoenix LiveView: Interactive, Real-Time Apps. No Need to Write JavaScript. - DockYard ) or Drab (Drab: Server Side User Interface Access) are what you are looking for. Search elixirforums for LiveView or Drab for more info - there is plenty around, and some great samples

pillaiindu

pillaiindu

I was thinking about how to make something in a way that there are partial updates to the pages but the user’s browser isn’t forced to calculate the json into html markup. Ahah is actually easier for the browser than the Ajax and now when there are faster Internet connections, ahah is more relevant than ajax.
I think pjax also uses Ahah under the hood.
in Rails when you’re loading something into a div using pjax, you send only the partial for that div, not the whole web-page. How would you do that (in a pragmatic way) in Phoenix?

Where Next?

Popular in Questions Top

_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> somethi...
New
tduccuong
Hi, is there any work on GUI with Elixir, that is similar to Electron/Javascript? My idea is to bundle Phoenix and BEAM into a single se...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New

Other popular topics Top

hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 43487 311
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 43757 214
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
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
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New

Latest on Elixir Forum

We're in Beta

About us Mission Statement