跳至內容
選單
此問題已被標幟
2 回覆
7522 瀏覽次數

I am trying to load custom js and css in my module but .css file is loading perfectly but js is  not loading.

my code is below

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="assets_backend_" name="Extra Feature" inherit_id="web.assets_backend">
<xpath expr=".">
<script type="text/javascript" src="/my_module/static/src/js/labou.js"/>
<link rel="stylesheet" href="/my_module/static/src/css/labou.css"/>
</xpath>
</template>

</data>
</odoo>
頭像
捨棄

debug with assets and check the console

最佳答案

Hi,

try it this way:

<template id="assets_frontend" inherit_id="website.assets_frontend">
    <xpath expr="script[last()]" position="after">
        <script type="text/javascript" src="/my_module/static/src/js/labou.js"></script>
    </xpath>
</template>

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
1月 21
11717
1
7月 16
11197
1
12月 24
4452
1
10月 20
4690
2
6月 20
4403