Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Aptana Studio:变量的jQuery代码完成/辅助_Javascript_Jquery_Aptana_Code Completion_Code Assist - Fatal编程技术网

Javascript Aptana Studio:变量的jQuery代码完成/辅助

Javascript Aptana Studio:变量的jQuery代码完成/辅助,javascript,jquery,aptana,code-completion,code-assist,Javascript,Jquery,Aptana,Code Completion,Code Assist,我在最新的Aptana插件(3.4)中使用jQuery的代码完成/辅助时遇到问题。它似乎无法推断类型: (function($) { $('p .test').each(function() { var $this = $(this); $(this).*DOES WORK* $this.*DOESN'T WORK* }); }(jQuery)); 当试图为一个由$创建的变量(this)完成代码时,我没有得到任何帮助:(你有什么建

我在最新的Aptana插件(3.4)中使用jQuery的代码完成/辅助时遇到问题。它似乎无法推断类型:

(function($) {
    $('p .test').each(function() {
        var $this = $(this);
        $(this).*DOES WORK*
        $this.*DOESN'T WORK*
    });
}(jQuery));
当试图为一个由$创建的变量(this)完成代码时,我没有得到任何帮助:(你有什么建议如何解决这个问题吗?

以下是答案:

(function($) {
    $('p .test').each(function() {
        var ele = $(this);
        $ele = $(this);
        $(this).*DOES WORK*
        ele.*DOES WORK*
        $ele.*DOES WORK*
    });
}(jQuery));

我不知道这是怎么一个答案,但这肯定是一个语法错误。@JanDvorak我忘了……谢谢:)!/编辑注意到。现在您正在使用globals(
$ele
)。感谢您的快速回复,但无法在全局范围内定义所有内容;-)此外,$ele和ele也不起作用。也许,你有一个不同的配置。我有Eclipse Classic 4.2(Juno)和最新的aptana插件(3.4.0.201304151542-7E7G-7EMVKUHGFCLGFBKKOZ0T-7)
var$(这)
是一个语法错误。你是说
var$this=$(this)
而不是
var$(this)=$this
?对不起,你说得对,我是说var$this=$(this)。但这也不行。这里不是有用的东西吗?你在阿普塔纳设定了项目性质吗?您可以通过“右键单击”项目->“属性”->“项目性质”进行设置。如果您使用的是PHP库,您可以在这里设置“web”和/或“PHP”。项目目录中有jQuery脚本文件吗?