留言板

own javascript

thumbnail
sujay paul,修改在12 年前。

own javascript

Regular Member 帖子: 164 加入日期: 11-10-28 最近的帖子
Hi ,

I want to add java script into portal-normal.vm.

Any one can help?

Thanks in advance.
thumbnail
Jitendra Rajput,修改在12 年前。

RE: own javascript (答复)

Liferay Master 帖子: 875 加入日期: 11-1-7 最近的帖子
place your custom javascript sources in the folder /docroot/js/custom.js

The velocity variable $javascript_folder is set to look in the /js
folder Not in the /_diffs/js/.

in the portal_normal.vm you include the javascript link to your file like this:
<script type="text/javascript" src="$javascript_folder/custom.js" charset="utf-8"></script>
thumbnail
sujay paul,修改在12 年前。

RE: own javascript

Regular Member 帖子: 164 加入日期: 11-10-28 最近的帖子
Thanks

Its working
but the i had put the js file in /docroot/js folder but it coppied in /_diffs/js/.

is create any problem?
thumbnail
Mayur Patel,修改在12 年前。

RE: own javascript

Expert 帖子: 358 加入日期: 10-11-17 最近的帖子
you should have all js files inside _diffs folder, after you deploy theme It will override default files reside at /docroot/js folder

Thanks