Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
755 Tampilan

Here In odoo 13 I create a website template. inside this template i add a button. I want to show a message after clicking the button in website but the website console no message showing. how can I do this here i added my code 
js:

odoo.define('spiralworld_agm_webinar.zoom_button', function (require) {
"use strict"

// Wait for the document to be fully loaded
$(document).ready(function () {
// Find the "Join Meeting" button by its ID
var joinMeetingButton = document.getElementById('joinMeetingButton');

if (joinMeetingButton) {
// Add a click event handler to the button
joinMeetingButton.addEventListener('click', function () {
// Display a message in the console
console.log("Button clicked - Join Meeting event handled.");
// You can add more code here to perform additional actions
});
}
});

});

I added this js in website.assets_frontend
Avatar
Buang
Jawaban Terbai

Hi,

You can refer this blog for you development


https://www.cybrosys.com/blog/how-to-load-dynamic-content-into-odoo-website-without-refreshing-the-page


This is for version 16 but for your case this can be a reference


In your case you are not following a oops concept, In odoo when creating website you need to extend or include a public widget


Regards

Avatar
Buang