<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>JavaScript on Poeticoding</title><link>https://www.poeticoding.com/category/javascript/</link><description>Recent content in JavaScript on Poeticoding</description><generator>Hugo</generator><language>en</language><lastBuildDate>Fri, 15 Jan 2021 20:07:10 +0000</lastBuildDate><atom:link href="https://www.poeticoding.com/category/javascript/index.xml" rel="self" type="application/rss+xml"/><item><title>Phoenix LiveView JavaScript Hooks and Select2</title><link>https://www.poeticoding.com/phoenix-liveview-javascript-hooks-and-select2/</link><pubDate>Wed, 05 Feb 2020 11:48:10 +0000</pubDate><guid>https://www.poeticoding.com/phoenix-liveview-javascript-hooks-and-select2/</guid><description>&lt;p>&lt;a href="https://www.poeticoding.com/using-select2-with-phoenix-liveview/">We&amp;rsquo;ve already played with Select2 and LiveView&lt;/a>, it was before the release of &lt;a href="https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html#module-js-interop-and-client-controlled-dom" target="_blank" rel="noopener">LiveView JS Hooks&lt;/a>. To make select2 work with LiveView we had to listen to &lt;code>phx:update&lt;/code> generic javascript events, re-initialize select2 and use a workaround to push events from the browser to LiveView.&lt;/p></description></item><item><title>Using Select2 with Phoenix LiveView</title><link>https://www.poeticoding.com/using-select2-with-phoenix-liveview/</link><pubDate>Thu, 11 Jul 2019 15:19:10 +0000</pubDate><guid>https://www.poeticoding.com/using-select2-with-phoenix-liveview/</guid><description>&lt;p>&lt;strong>IMPORTANT&lt;/strong>: It&amp;rsquo;s now possible to do LiveView JS interop with hooks, which make everything much simpler and smoother! I&amp;rsquo;ve published an updated version of the article: &lt;a href="https://www.poeticoding.com/phoenix-liveview-javascript-hooks-and-select2/">Phoenix LiveView JavaScript Hooks and Select2&lt;/a>.&lt;/p>
&lt;p>LiveView doesn&amp;rsquo;t support JavaScript interop at the moment (but it&amp;rsquo;s a planned feature). So, let&amp;rsquo;s see how we can come up with a workaround to make LiveView playing together with a JavaScript library like &lt;a href="https://select2.org" target="_blank" rel="noopener">Select2&lt;/a>.&lt;/p></description></item><item><title>Add a Progress Bar in the Phoenix File Upload app</title><link>https://www.poeticoding.com/add-a-progress-bar-in-the-phoenix-file-upload-app/</link><pubDate>Wed, 29 May 2019 12:22:38 +0000</pubDate><guid>https://www.poeticoding.com/add-a-progress-bar-in-the-phoenix-file-upload-app/</guid><description>&lt;ul>
&lt;li>Part 1: &lt;a href="https://www.poeticoding.com/step-by-step-tutorial-to-build-a-phoenix-app-that-supports-user-uploads/">Step-by-Step Tutorial to Build a Phoenix App that Supports User Upload&lt;/a>&lt;/li>
&lt;li>Part 2: &lt;a href="https://www.poeticoding.com/creating-thumbnails-of-uploaded-images-and-pdf-in-phoenix/">Creating Thumbnails of uploaded Images and PDF in Phoenix&lt;/a>&lt;/li>
&lt;li>Part 3: this article&lt;/li>
&lt;/ul>
&lt;p>In the previous two parts we&amp;rsquo;ve seen how to create a Phoenix application with a multipart upload form, that creates thumbnails of images and PDF.&lt;/p></description></item></channel></rss>