我想用template.find
让我的生活更轻松。流星template.find是undefined
但在JavaScript控制台我得到:undefined is not a function
这里是我的。它被绊倒了template.find(...)
Template.superuserHUD.events =
{
'click input.new_device': function (template) {
var id = template.find(".new_device_id").value;
Device_IPs.insert({ID: id, IP: "Not Connected"});
}
}
任何想法?
,而不是发现,选择相匹配的元素,你应该直接检索元素的值文本使用'.getElementById()'方法 –
嗨user1191551,你已经提出了5个问题,但没有接受任何答案。在这里接受你认为有用的答案是常见的礼节。它还将提高针对未来问题的答案质量。谢谢! – Rahul
谢谢Rahul。看起来,我似乎有2个不同的帐户,因为我已经明确回答并接受了比此帐户显示的更多答案... – Chet