Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda

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>
Avatar
Buang

debug with assets and check the console

Jawaban Terbai

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>

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
1
Jan 21
11732
1
Jul 16
11219
1
Des 24
4491
1
Okt 20
4710
2
Jun 20
4414