2013-05-11 58 views
2

我在使用最新的Aptana插件(3.4)中的代码完成/辅助jQuery方面遇到问题。这似乎并不能够推断类型:Aptana Studio:jQuery代码完成/辅助变量

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

当试图获得代码完成创作出来的$(这)一个变量,我没有得到任何帮助:(你有什么忠告如何让这个解决

+1

'变量$(这)'是一个语法错误,你的意思是'变量$此= $(本)',而不是'变种。 $(this)= $ this''? – 2013-05-11 18:56:54

+0

对不起,你说得对,我的意思是var $ this = $(this),但那也行不通。 – 2013-05-11 22:32:36

+0

不是这里有用的东西L· http://stackoverflow.com/questions/2458071/code-completion-aptana-eclipse-plugin#9917433 – Stano 2013-05-11 23:50:35

回答

0

下面是答案:

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

我不知道这是一个答案,但'var this'是_definitely_语法错误。 – 2013-05-11 18:55:11

+0

@JanDvorak我忘了...谢谢:)! //编辑 – 2013-05-11 18:59:04

+0

编辑注意。现在你正在溢出全局变量('ele')。 – 2013-05-11 19:00:23