我的各种简单代码:var ac = Y.Plugin.AutoComplete(“searchInput”,“results”);YUI自动完成插件未定义
错误:遗漏的类型错误:对象#有没有方法“自动完成”
,我需要包括一些具体的js文件还是...?
我的各种简单代码:var ac = Y.Plugin.AutoComplete(“searchInput”,“results”);YUI自动完成插件未定义
错误:遗漏的类型错误:对象#有没有方法“自动完成”
,我需要包括一些具体的js文件还是...?
这可能意味着你没有把它称为正确的方式。尽管以前我没有使用它,但文档说它只需要一个参数,而不是两个字符串。见AutoComplete API:
init (config) Base
Inherited from BaseCore but overwritten in base/js/Base.js:191
Init lifecycle method, invoked during construction. Fires the init event prior to setting up attributes and invoking initializers for the class hierarchy. Parameters:
config Object Object with configuration property name/value pairs
Returns: Base: A reference to this object
所以,你应该尝试创建一个配置对象,并把它作为参数。
Alexis