<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: How to get param ln when loading a HtmlUserDialog page</title><link>https://answers.axonivy.com/questions/1106/how-to-get-param-ln-when-loading-a-htmluserdialog-page</link><description>&lt;p&gt;Hi all,&lt;/p&gt;
&lt;p&gt;I have a HtmlUserDialog project and have a page which included some js/css file. Normally we just use the tag like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;script src="#{resource['ivy-webcontent:js/xportal-common.js']}" /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And i can see after the page was loaded, the code will be:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;script src="/ivy/faces/javax.faces.resource/js/xportal-common.js?ln=xpertivy-5-webContent"&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can see this &amp;lt;script&amp;gt;, it is always end with param &lt;strong&gt;ln=xpertivy-&amp;lt;number&amp;gt;-webContent&lt;/strong&gt;
The &amp;lt;number&amp;gt; here is different.
So, for example, when i use some third party js libraries, it have some code to load some others js files by javascript after page loaded, but it can't because i don't have the right &amp;lt;number&amp;gt; of param &lt;strong&gt;ln&lt;/strong&gt;. If anyone here used to use RequireJS, you can understand the situation.&lt;/p&gt;
&lt;p&gt;My question is: There is any way to know exactly the parameter &lt;strong&gt;ln&lt;/strong&gt; that ivy will put to the end of &amp;lt;script&amp;gt; ?&lt;/p&gt;
&lt;p&gt;Note: Actually i can get this value by using javascript to read other existing &amp;lt;script&amp;gt; and copy from there but i really don't like that way.&lt;/p&gt;
&lt;p&gt;Anyone can have me?&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/1106/how-to-get-param-ln-when-loading-a-htmluserdialog-page" rel="self"></atom:link><language>en</language><lastBuildDate>Tue, 06 Jan 2015 14:29:13 -0500</lastBuildDate><item><title>Answer by Reto Weiss</title><link>https://answers.axonivy.com/questions/1106/how-to-get-param-ln-when-loading-a-htmluserdialog-page/1107</link><description>&lt;p&gt;You can use the &lt;code&gt;#{resource['ivy-webcontent:mypath']}&lt;/code&gt; not only in .xhtml files but also in .css and .js files that you load over the jsf resource mechanism. 
JSF will automatically replace and expand the &lt;code&gt;#{resource[...]}&lt;/code&gt; with the right url.&lt;/p&gt;
&lt;p&gt;In your example use &lt;code&gt;#{resource[...]}&lt;/code&gt; in the xportal-common.js file to reference other files in the webContent folder. JSF will automatically replace the &lt;code&gt;#{resource[...]}&lt;/code&gt; with the right url when sending the file to the web browser.&lt;/p&gt;
&lt;p&gt;Have a look at the file &lt;code&gt;webContent/layouts/styles/ivy-common.css&lt;/code&gt; in the HtmlDialogDemos project to see how &lt;code&gt;#{resource[...]}&lt;/code&gt; can be used in a .css file. This also works in .js files.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reto Weiss</dc:creator><pubDate>Tue, 06 Jan 2015 14:29:13 -0500</pubDate><guid>https://answers.axonivy.com/questions/1106/how-to-get-param-ln-when-loading-a-htmluserdialog-page/1107</guid></item></channel></rss>