Solved

JavaScript in Eclipse

Posted on 2013-01-21
4
473 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

770 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