【发布时间】:2016-05-19 19:18:15
【问题描述】:
我想在我的 Node JS 应用中使用 Geocomplete (Github example),一个 JQuery 插件。我对网络应用程序相当陌生,并且无法弄清楚如何集成 JQuery 的东西。
我正在渲染我的页面:
render() {
let { input } = this.state;
return (
<div className="row">
<div className="col s12">
<h4>Welcome!</h4>
<input
id="geocomplete"
placeholder="Enter a search location”
type="text"
onChange={this.onInputChange.bind(this)}
value={input} />
<a
onClick={this.onSearchClick.bind(this)}
className='waves-effect waves-light btn'>Search!</a>
</div>
</div>
)
}
该示例显示执行以下操作:
$("#geocomplete").geocomplete()
但我似乎无法在 render() 中执行此操作,所以我不确定如何操作。 有什么想法吗?
谢谢!
【问题讨论】:
标签: javascript jquery node.js geocomplete