Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » jsNature causing problem markers
jsNature causing problem markers [message #226927] Wed, 21 January 2009 09:42 Go to next message
Michael Giroux is currently offline Michael Giroux
Messages: 78
Registered: July 2009
Location: Phoenix, AZ
Member
The project that I'm working on contains a folder named 'js' containing
various javascript sources. When I add jsNature to the .project, I am
getting several problem markers due to unresolved symbols.

The project runs without errors in a browser, but the design time Eclipse
environment is flagging all sorts of errors.

I have included my 'js' folder as a library folder, but I'm still getting
several error markers. The errors are not consistent within a file
either. For example, I have a source with two functions:

function a() {
var x = commentForm.getElement('id'); // <-- no errors here
return x;
}

function b() {
if (!isEmpty(commentForm.getElement('id')) return true; // <--
commentForm undefined here
return false;
}

In function a(), the reference to commentForm does not raise an error.
In function b(), the reference to commentForm as an argument to the
isEmpty method produces a problem marker indicating commentForm cannot be
resolved.

So far, I don't see a pattern to when a references causes a validation
error and when it doesn't.

Any pointers to docs that might get me back on track will be appreciated.

Thanks
Michael
Re: jsNature causing problem markers [message #226934 is a reply to message #226927] Wed, 21 January 2009 10:17 Go to previous message
Michael Giroux is currently offline Michael Giroux
Messages: 78
Registered: July 2009
Location: Phoenix, AZ
Member
Another example:

var counter = document.createElement('div');
. . .
textField.relatedElement = counter.getElementsByTagName('span')[0];

For the above, I'm getting a problem marker:
The function getElementsByTagName(String) is undefined for the type
___counter3

It appears that jsNature is enforcing stricter syntax than the browser is.


How should the above be coded to avoid the problem marker?

Michael
Previous Topic:JavaScript Model Exception: Java Model Status
Next Topic:PermGem-Ganymede Drivine me crazy!
Goto Forum:
  


Current Time: Thu Jul 24 23:47:30 EDT 2014

Powered by FUDForum. Page generated in 0.01445 seconds