Link to home
Start Free TrialLog in
Avatar of anAppBuilder
anAppBuilderFlag for United States of America

asked on

JavaScript in Eclipse

I'm learning JavaScript.  I've written PHP using Eclipse and I like Eclipse.  But when I create a JavaScript project in Eclipse, and enter some code, it shows all the HTML in the code as errors.  What am I doing wrong?
ASKER CERTIFIED SOLUTION
Avatar of IanTh
IanTh
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of anAppBuilder

ASKER

Thank you, Ian.
But the problem persists even if I change the extension to . html.
please show me the errors
Thank you, Ian.  That got me going in the right direction.  

It turns out it's kind of interesting, as I discovered when I set out to clearly show the errors.  If you start out with the extension .html, all is well.  If you start out with .js and then rename it to .html, some errors remain.

In Eclipse Indigo, I created a .js and a .html and pasted a very simple Javascript example from this page http://www.w3schools.com/js/default.asp into each of them.

Many errors in the .js
     Renaming to .html does not remove the errors
     Select all, cut, then paste back into the same file removes all errors but one.  It wants to delete the < on the closing </html>
     Select all, cut, then paste back into a new .html file removes all errors
No errors in the .html.