How to include JavaScript file in Liferay Portlet? - Stack Overflow

I am not able to include . Whenever I load my portlet for the first time it doesn't work but if I

I am not able to include . Whenever I load my portlet for the first time it doesn't work but if I refresh the same page then it starts working fine. I don't know what the issue is. Please Help.

I am not able to include http://maps.googleapis./maps/api/js?sensor=false. Whenever I load my portlet for the first time it doesn't work but if I refresh the same page then it starts working fine. I don't know what the issue is. Please Help.

Share Improve this question edited Sep 30, 2011 at 8:20 Yi Jiang 50.2k16 gold badges139 silver badges136 bronze badges asked Sep 30, 2011 at 5:08 rkgrkg 1751 gold badge3 silver badges13 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 3

One of the clean ways to include js file in a portlet, independent of the portal server is to configure in portlet deployment descriptor file as below. For liferay, it would be liferay-portlet.xml.

<portlet>
    <portlet-name>MySamplePortlet</portlet-name>
    <header-portlet-javascript>http://maps.googleapis./maps/api/js?sensor=false</header-portlet-javascript>
</portlet>

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745422518a4627028.html

相关推荐

  • How to include JavaScript file in Liferay Portlet? - Stack Overflow

    I am not able to include . Whenever I load my portlet for the first time it doesn't work but if I

    13小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信