admin管理员组文章数量:1431904
I just started using netbeans (NetBeans IDE 7.2 (Build 201207171143) under Win7/64bit) to try out jQuery developement. Especially the autopletion seemed very handy..
I used this tutorial: .html I did everything like in this tutorial but took the current version of jQuery.js (v1.8.0) instead of the older 1.4.2-revision.
Lets look at the following code snipped:
<script type="text/javascript">
$(document).ready(function(){
$("h1").click(function(){ alert ("HI!"); });
});
</script>
The autopletion works for "$(document)." and suggests "ready". So far, so good...
The 3rd line starts with "$("h1")." after that selector followed by "." I get a lot of suggestions but not for "click"; When I use the older jQuery-1.4.2.js it works as seen in the following screenshot of the tutorial: .png
Questions:
- What's actually the problem here?
- Can we somehow get this working with the current version of jQuery? If so: How?
- Who's potentially in charge here ... bug in jQuery or netbeans?
Regards, Stefan
--- update ---
The problem only occurs if you add a <script type="text/javascript" src="js/jquery.js"></script>
to the source code. If you omit the include, it's working as it should.
So this seems to be an issue of Netbeans. And lead us to the following adapted question:
Question: Not including the jquery.js is just a workaround. Is there a way to fix that? Maybe it's needed that we disable some "auto-include-everything" option somewhere in the project?
--- update #2 : SOLUTION ---
It's even the name of the included script <script type="text/javascript" src="jq.js"></script>
works, but any resource name ending in 'jquery.js' don't work, whereas <script type="text/javascript" src="jquery-1.8.0.js"></script>
worked!
So it's actually a kind of bug in Netbeans, that is caused by some hardcoded stuff. And the solution is to rename the JavaScript file in a way that it e.g. still includes the revision.
I just started using netbeans (NetBeans IDE 7.2 (Build 201207171143) under Win7/64bit) to try out jQuery developement. Especially the autopletion seemed very handy..
I used this tutorial: http://netbeans/kb/docs/web/js-toolkits-jquery.html I did everything like in this tutorial but took the current version of jQuery.js (v1.8.0) instead of the older 1.4.2-revision.
Lets look at the following code snipped:
<script type="text/javascript">
$(document).ready(function(){
$("h1").click(function(){ alert ("HI!"); });
});
</script>
The autopletion works for "$(document)." and suggests "ready". So far, so good...
The 3rd line starts with "$("h1")." after that selector followed by "." I get a lot of suggestions but not for "click"; When I use the older jQuery-1.4.2.js it works as seen in the following screenshot of the tutorial: http://netbeans/images_www/articles/69/web/js-toolkits-jquery/code-pletion.png
Questions:
- What's actually the problem here?
- Can we somehow get this working with the current version of jQuery? If so: How?
- Who's potentially in charge here ... bug in jQuery or netbeans?
Regards, Stefan
--- update ---
The problem only occurs if you add a <script type="text/javascript" src="js/jquery.js"></script>
to the source code. If you omit the include, it's working as it should.
So this seems to be an issue of Netbeans. And lead us to the following adapted question:
Question: Not including the jquery.js is just a workaround. Is there a way to fix that? Maybe it's needed that we disable some "auto-include-everything" option somewhere in the project?
--- update #2 : SOLUTION ---
It's even the name of the included script <script type="text/javascript" src="jq.js"></script>
works, but any resource name ending in 'jquery.js' don't work, whereas <script type="text/javascript" src="jquery-1.8.0.js"></script>
worked!
So it's actually a kind of bug in Netbeans, that is caused by some hardcoded stuff. And the solution is to rename the JavaScript file in a way that it e.g. still includes the revision.
2 Answers
Reset to default 5 +50Looks like you're using a minified version of jQuery, because you're likely getting code pletition from JS core, so you need to include in your project the development version or both (development and minified), if you're pushing code to production, to get jQuery code pletition and API especifications. Watch this:
One possible problem might be that click()
has been depreciated in favor of on()
Of course click()
without parameters is still used to fire the event, so I'm probably wrong but see if this autopletes correctly:
$("h1").on("click",function(){ alert ("HI!"); });
Note: on()
was introduced in version 1.7
本文标签: javascriptNetbeans autocompletion not fully working with current jQueryjs (v180)Stack Overflow
版权声明:本文标题:javascript - Netbeans autocompletion not fully working with current jQuery.js (v1.8.0) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745581957a2664674.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论