javascript - 如何在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');
}
});
});
注意值未定义。帮助,我需要任何解决方案吗?
解决方案
推荐阅读
- javascript - 语法错误 Ruby 简单表单相关字段 gem Haml
- python - 我的 API 密钥的放置有什么问题?
- go - Visual Studio Code Go 调试中的编译器优化
- c - c - 链表中的指针问题
- google-bigquery - 连接谓词中的表不受支持的子查询
- mysql - 计数最多捐赠者 SQL
- node.js - 为什么我在 Express 上设置 CORS 时出现飞行前错误?
- angular - Angular 7/Ionic 4 - 背景图像 url 路径问题
- angular - 离子无法连接到服务器
- spectral-density - 转换功率谱密度的维度