NetBeans jQuery plugin code completion - netbeans

I'm using NetBeans for PHP. When I edit a .js file, it gives me JavaScript code completion. How can I get it to also give me jQuery code completion?
NetBeans 6.9 code auto-complete is not working for jQuery plug-ins.
The code auto-complete is working for jQuery but not for plug-ins such as the validate plugin.
Is this a bug in NetBeans 6.9?

Try this
http://netbeans.org/kb/docs/web/js-toolkits-jquery.html
or
You can also try following
http://forums.netbeans.org/topic15076.html
I add jquery.js to include path of project and it's working fine for me.

I was having the same problem. I have Netbeans 7.2.1 under linux (in an Oracle VirtualBox).
I had copied the jquery library 1.10.2 (not minified) into my own project
I had added the path into the Project Properties > PHP Include path
I still had no auto-complete
I found a solution based on How to include js file in another js file?
I type out the following in the header:
var imported = document.createElement('script');
imported.src = 'jquery-1.10.2.js'; // I put the jquery library in the same folder
document.head.appendChild(imported);
Now I get auto-completion!

Related

Netbeans Code Completion

Is there any netbeans trick that would do like Sublime text that if you just type div.header-class then it will then just automatically formulate `
<div class=header-class"></div>
How to do that trick? or is it possible?
I think this is probably through a plugin known as Emmet.
NetBeans has a plugin for it too. The plugin page indicates that it's for older versions, but the comments are reporting success with version 8.1. Incidentally, it doesn't show up in the plugin manager from NetBeans on Windows for me, but the GitHub page looks active though.
The Emmet download page points to this repo.
In Netbeans you have Code templates:
Code templates are prewritten snippets of code provided by NetBeans IDE. You can paste a snippet into your code by using code completion or the template's abbreviation followed by the Tab key.
Following the tutorial linked you can define your own code template to meet your requirements.

can tern eclipse validate javascript in html files?

I am trying to use Tern Eclipse IDE in a static web project. Alas, I'm not able to configure it to validate javascript in script tags in .html files. Is this even supported? Is there any doc how to do it?

PhantomJS Project in Eclipse (with Nodeclipse): NullPointerException when trying to run js file that is present in a folder

I wish to create a PhantomJS Project in Eclipse for which I have installed the Nodeclipse PhantomJS 0.12+ plugin. I am selecting the below project type:
The script runs fine when I arrange the project in the following way (without any folders).
But, when I place the same .js file in a folder and try to run it, I end up getting a NullPointerException (see screenshot below).
The error that I'm getting is below:
An internal error occurred during: "Launching PhantomJSTest-Test1.js".
java.lang.NullPointerException
Screenshot:
What I have tried:
I found a similar question on Stackoverflow with the same error but for Android. I have tried cleaning, building the project. But, the error occurs only when I create a folder structure in my project. If I don't, then the script runs fine. In short, I am not able to organize the project.
Questions:
I'd like to know what type of folder structure is valid / will work for a PhantomJS project?
Why is the NullPointerException occuring?
Are there any other easy alternatives to setting up a PhantomJS project?
Any help / guidance regarding the folder structure is highly appreciated.
First get the latest version, that is 0.17, see news/history at http://www.nodeclipse.org/
If the problem is still on, raise issue on https://github.com/nodeclipse/nodeclipse-1/ (and reference this question)
To the questions:
PhantomJS launcher is rather simple https://github.com/Nodeclipse/nodeclipse-1/tree/master/org.nodeclipse.phantomjs, and it should work for any .js file (in any project type). PhantomJS project type is for beauty sake only, as it is just JavaScript project.
NullPointerException should occur never, so it may be bug.
You can create general project as well. But with JSDT and Tern you would get some Content Assist. For new module support with Tern raise issue at https://github.com/angelozerr/tern.java/
I switched to using Enide Studio and that solved the folder structure issue for me.
Here's what is needed to setup PhantomJS Project:
PhantomJS
Enide Studio
Steps:
Download PhantomJS
Download and launch Enide Studio
Goto Window->Preferences->Nodeclipse->PhantomJS and set PhantomJS Path to 'phantomjs.exe' file path
Create a PhantomJS Project (like any normal project)

Load MCFileManager TinyMCE plugin from external location

i saw in the changelog of MCFileManager the following feature:
Version 3.0.6 (2008-02-21)
Added support for loading the TinyMCE plugin from an external location.
But how can i do this?
When i load the editor_plugin.js file and i enable the plugin in the tinyMCE settings, then i get only errors because the paths are not correct.
In the tinyMCE documentation i've found this:
TinyMCE also supports the ability to have plugins added from a external resource. These >plugins need to be self registering and loaded after the tinyMCE.init call. You should >also prefix these plugins with a "-" character, so that TinyMCE doesn't try to load it >from the TinyMCE plugins directory.
but when i add the plugin using "-insertimage" nothing is loaded.
Thanks for your help,
dattn

Failed to create HTML page using GWT plugin for Eclipse

When i create a new GWT (version 2.3) project using the Eclipse (version 3.5) plugin, without enabling sample code, i failed to create a new HTML page by using the GWT->new HTML page. It opens the dialog window, i enter the name of the file and the module, but when i press 'finish', it does nothing! Bug or my mistake?
It is gwt eclipse plugin bug.. Here is the exception ;
java.lang.NullPointerException
at com.google.gdt.eclipse.core.ResourceUtils.getResourceAsString(ResourceUtils.java:655)
at com.google.gdt.eclipse.core.ResourceUtils.getResourceAsString(ResourceUtils.java:467)
at com.google.gwt.eclipse.core.wizards.NewHostPageWizard.getDocType(NewHostPageWizard.java:216)
at com.google.gwt.eclipse.core.wizards.NewHostPageWizard.getInitialContents(NewHostPageWizard.java:148)
See bug #6338
Try looking in the \war folder of your project, html files are put there.
It's a bug.
Temporary Solution:
Just create GWT Project with sample contents. than you can see html file in war.
Copy that into your project. Modify it. (It's easy to inspect)