RE: <portlet:namespace/> is not resolving with current portlet name?

Surendra K, modified 7 Years ago. New Member Posts: 17 Join Date: 9/10/14 Recent Posts

Hi,

I am including js file in  portlet class as  "com.liferay.portlet.footer-portlet-javascript=/js/main.js" , In main.js i have written some functions,

ex

function test(){
    
    var ab=document.getElementById("<portlet:namespace/>element1").value;

}

<portlet:namespace/> is not resolving with the current portlet name and converting as 

var ab= document.getElementById("\x3cportlet:namespace/\x3eelement1").value;  

 

All your feedback is highly appreciated . 

 

 

thumbnail
Minhchau Dang, modified 7 Years ago. Liferay Master Posts: 598 Join Date: 10/22/07 Recent Posts
Surendra K:
function test(){
    var ab=document.getElementById("<portlet:namespace/>element1").value;
}
You can't use tag libraries in plain Javascript files. Tag libraries only work in JSPs and Freemarker templates.
Surendra K, modified 6 Years ago. New Member Posts: 17 Join Date: 9/10/14 Recent Posts
Thank you Minhchau Dang for  your response.