我经常遇到 jquery 和流星的这个问题,我得到一个未定义的不是函数,我就是不知道为什么。
这是我安装的pagedown-bootstrap包的代码。错误的链接这是正确的来源
Template.postSubmit.rendered = function () {
$("textarea#pagedownMe").pagedownBootstrap();
};
我的html模板
<template name="postSubmit">
<form class="submitForm">
<label for="date">Date</label>
<input name="date" type="text" value="" placeholder="Date"/>
<label for ="title">Title</label>
<input name ="title" type="text" value="" placeholder="title"/>
<label for="content">Content</label>
<textarea id="pagedownMe" name="content" class="form-control" rows="10">
This is the *first* editor.
------------------------------
Just plain **Markdown**, except that the input is sanitized:
<marquee>I'm the ghost from the past!</marquee>
</textarea>
<input type="submit" value="Submit" />
</form>
</template>
我得到的错误
Exception from Deps afterFlush function function: TypeError: undefined is not a function
at Object.Template.postSubmit.rendered (http://localhost:3000/client/postsPagedown.js?05d5727bffc4120f5b1e1765e9451a7571bbd788:5:26)
at http://localhost:3000/packages/ui.js?f0696b7e9407b8f11e5838e7e7820e9b6d7fc92f:426:23
at _assign.flush (http://localhost:3000/packages/deps.js?91f1235baecd83915f7d3a7328526dbba41482be:345:13)
来自大气的包装
主包pagedown-bootstrap 依赖标记