Questions Tagged With htmldialoghttps://answers.axonivy.com/tags/htmldialog/?type=rss&user=TareqKquestions tagged <span class="tag">htmldialog</span>enFri, 28 Feb 2020 07:44:51 -0500Loading ES6 imports and Moduleshttps://answers.axonivy.com/questions/4431/loading-es6-imports-and-modules<p>Hello, So i was follwoing the xample in the HTMLDialogDemos, and I tried to create an es6 module and import it. This worked, however, the imports that my module require are not being imported correctly. This is due to the fact that ES6 imports dont automatically ad the "ln=xpertivy-3-webContent" query param that its calling module got. </p> <p>To be clear, i imported page.js via </p> <pre><code>&lt;h:outputScript a:type="module" library="js/PureHtmlDialog" name="page.js"&gt; &lt;/h:outputScript&gt; </code></pre> <p>which gets the file at</p> <pre><code><a href="http://localhost:8081/ivy/faces/javax.faces.resource/resources/js/PureHtmlDialog/page.js?ln=xpertivy-3-webContent&amp;xv=124700577218">http://localhost:8081/ivy/faces/javax.faces.resource/resources/js/PureHtmlDialog/page.js?ln=xpertivy-3-webContent&amp;xv=124700577218</a> </code></pre> <p>which attempts to import </p> <pre><code>import {Button,Column,Header} from "../component.js"; </code></pre> <p>which in turn gets the URL</p> <pre><code><a href="http://localhost:8081/ivy/faces/javax.faces.resource/resources/js/component.js">http://localhost:8081/ivy/faces/javax.faces.resource/resources/js/component.js</a> </code></pre> <p>if I try to visit the URL</p> <pre><code><a href="http://localhost:8081/ivy/faces/javax.faces.resource/resources/js/component.js?ln=xpertivy-3-webContent">http://localhost:8081/ivy/faces/javax.faces.resource/resources/js/component.js?ln=xpertivy-3-webContent</a> </code></pre> <p>then i can see the file correctly. </p> <p>I also tried to, inside the folder of the HTML dialog itself, to put a javascript file and import it with a plain script tag. This didnt work, and actually crashed the page. </p> <p>Is there a better way to do javascript file imports and es6 imports?</p>TareqKFri, 28 Feb 2020 07:44:51 -0500https://answers.axonivy.com/questions/4431/loading-es6-imports-and-moduleshtmluserdialoghtmldialogjavascript