jsNature causing problem markers [message #226927] |
Wed, 21 January 2009 09:42  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.23921 seconds