首页 > 解决方案 > 如何在odoo中获取价值js网站模块?

问题描述

我想如果注释字段有价值,请发出警报。我的代码是:

odoo.define('website_sale_product_list.product', function (require) {
    "use strict";
    var ajax = require('web.ajax');
    $(window).load(function(){
      console.log('dg');
       var note = $('#note').val();
       console.log(note + '        note');
       var comment = document.getElementById("note").value;
       if( comment != null && comment != undefined) {
            alert(comment);
        }
        else {
            alert(comment + '       0');
        }

   });
});

注意值未定义。帮助,我需要任何解决方案吗?

标签: javascriptwebodoo

解决方案


推荐阅读