【发布时间】:2013-05-11 18:39:50
【问题描述】:
我在最新的 Aptana 插件 (3.4) 中使用 jQuery 的代码完成/辅助时遇到问题。它似乎无法推断类型:
(function($) {
$('p .test').each(function() {
var $this = $(this);
$(this).*DOES WORK*
$this.*DOESN'T WORK*
});
}(jQuery));
当尝试为 $(this) 创建的变量完成代码时,我没有得到任何帮助 :( 你有什么建议可以解决这个问题吗?
【问题讨论】:
-
var $(this)是语法错误。您的意思是var $this = $(this)而不是var $(this) = $this? -
对不起,你是对的,我的意思是 var $this = $(this)。但这也不起作用。
-
这里不是有用的东西吗? stackoverflow.com/questions/2458071/…
-
您是否在 Aptana 中设置了项目性质?您可以通过“右键单击项目”->“属性”->“项目性质”来设置它们。如果您使用 PHP 库,您可以在此处设置“web”和/或“PHP”。并且你的项目目录中有 jQuery-scriptfile 吗?
标签: javascript jquery aptana code-completion code-assist