2

I had netbeans 6.9, and i was trying to edit javascript on it. However, I keep getting code errors in my .js files. I can't even create a new javascript template. I tried upgrading to netbeans 7.01, but this doesn't change. I also enabled the JAVA plugin, but it doesn't help.

Anyone know what's going on?

5
  • Works for me... What kind of errors are you getting? Commented Sep 20, 2011 at 17:32
  • What version of netbeans are you using? Refer to this table: netbeans.org/downloads PHP means (PHP + HTML + CSS + Javascript) Commented Sep 20, 2011 at 17:48
  • I'm currently using the PHP version of netbeans Commented Sep 20, 2011 at 17:56
  • Hmmm... How are you getting code errors if you don't get JavaScript support? Commented Sep 20, 2011 at 17:59
  • I get a bunch of errors where it says "unclosed character literal" or "character, interface, or enum expected" Commented Sep 20, 2011 at 18:01

2 Answers 2

4

I get a bunch of errors where it says "unclosed character literal" or "character, interface, or enum expected"

I suspect you've somehow configured NetBeans to handle *.js files as Java, which is an entirely different language.

Go to Tools-> Options-> Miscellaneous-> Files and find js in the "File Extension" combo. The "Associated File Type (MIME)" input box should say text/javascript.

Sign up to request clarification or add additional context in comments.

1 Comment

AHH THIS FIXED IT! Thank you so much! I wonder why it reset to java. Darn thing. I would vote up if i had the rep count right now. haha
1

the java-plugin is for java, so this won't help you.

what you'll need is to activate javascript-support. javascript is included in the PHP-pack (and also available as plugin).

to install the plugin, simply click tools -> plugins and install PHP to enable javascript-(and html-)support.

6 Comments

I downloaded the PHP package, so that's the problem. I don't get any options to install the PHP plugin since.. i already downloaded the PHP version of netbeans.
@perissf: simply click on my link - just because you didn't heard of something doesn't mean it isn't real: netbeans.com/downloads/…
@Handonam: the php-package definitely supports javascript - is it possible you simply have real errors in you code? could you please post some code and the exact error-message netbeans gives for it?
Here's a simple version that I know works, because my coworker has the same codebase as I do:
index.initFilterBehavior = function() { var searchSelector = [ index.selectors.searchFormTextFields, index.selectors.searchFormSelectFields, index.selectors.searchFormCheckboxFields, index.selectors.searchFormRadioFields ].join(', '); $(searchSelector).change(function() { index.initSearchData(); index.initSearch(); }); }
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.