Solved

JavaScript in Eclipse

Posted on 2013-01-21
4
470 Views
Last Modified: 2013-01-22
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?
0
Comment
Question by:anAppBuilder
  • 2
  • 2
4 Comments
 
LVL 30

Accepted Solution

by:
IanTh earned 500 total points
ID: 38804158
thats the way elipse works isn't it the errors are probably because your JavaScript is not an html page
0
 

Author Comment

by:anAppBuilder
ID: 38804180
Thank you, Ian.
But the problem persists even if I change the extension to . html.
0
 
LVL 30

Expert Comment

by:IanTh
ID: 38804203
please show me the errors
0
 

Author Comment

by:anAppBuilder
ID: 38808176
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.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now