嗨,我有一个基本功能,我正在尝试开始工作。请告诉我您发现此问题的任何原因。
'click #addTag': function(event, template) {
var tagTitle = template.find("#AddVideoTags").value;
window.alert(tagTitle);
}
最佳答案
我的猜测是 template.find("#AddVideoTags") 未定义,当您尝试访问 .value 时,它会引发错误。我在一些虚拟代码中重现了这一点:
'click #addTag': function(event, template) {
window.alert('This will work');
var tagTitle = template.find("#ThisDoesNotExist").value; // This throws an exception.
window.alert(tagTitle); // This will not execute.
}
关于javascript - 基本 Window.alert 功能在 Meteor 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34968974/