<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: Access CMS in Javascript file</title><link>https://answers.axonivy.com/questions/1873/access-cms-in-javascript-file</link><description>&lt;p&gt;Hello All,&lt;/p&gt;
&lt;p&gt;Is it possible to reference CMS resources in a Javascript file ? (Like in the way we access them in CSS file)&lt;/p&gt;
&lt;p&gt;Also is it possible to get resources from the CMS via Ajax from Html DIalog ?&lt;/p&gt;
&lt;p&gt;Best Regards,
Yordan Yunchov&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/1873/access-cms-in-javascript-file" rel="self"></atom:link><language>en</language><lastBuildDate>Mon, 11 Jul 2016 12:00:54 -0400</lastBuildDate><item><title>Answer by Reto Weiss</title><link>https://answers.axonivy.com/questions/1873/access-cms-in-javascript-file/1876</link><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;It is &lt;strong&gt;not&lt;/strong&gt; possible to use EL expressions in Javascript files in JSF. See &lt;a href="http://stackoverflow.com/questions/2547814/mixing-jsf-el-in-a-javascript-file"&gt;http://stackoverflow.com/questions/2547814/mixing-jsf-el-in-a-javascript-file&lt;/a&gt; for workarounds.&lt;/p&gt;
&lt;p&gt;Every resource can be get from the web server. Therefore it should be possible to get it via Ajax Request. The Request path will be something like:&lt;/p&gt;
&lt;p&gt;/ivy/faces/javax.faces.resource/Project/Banner?ln=xpertivy-6-cms&lt;/p&gt;
&lt;p&gt;for &lt;/p&gt;
&lt;p&gt;&amp;lt;p:graphicimage library="ivy-cms" name="/Project/Bannner"/&amp;gt;&lt;/p&gt;
&lt;p&gt;The 6 in the ln query parameter is the identifier of the PMV where your project is deployed to.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reto Weiss</dc:creator><pubDate>Mon, 11 Jul 2016 12:00:54 -0400</pubDate><guid>https://answers.axonivy.com/questions/1873/access-cms-in-javascript-file/1876</guid></item></channel></rss>