JSDT syntax errors [message #227151] |
Sat, 24 January 2009 01:13 |
No real name Messages: 1 Registered: July 2009 |
Junior Member |
|
|
I'm trying to use the JavaScript tools in Eclipse 3.4.1 for the first
time. I've created a JavaScript project, I've enabled "Web Based
JavaScript Support", and I've added the FireFox Browser Support Library to
my libraries.
I get spurious errors from the JavaScript editor when I use a property
that is not part of the ECMA 3 Browser Support library Element, but it is
specified in the FireFox Browser Support Library
HTML[Html|Body|Head|Script]Element.
The example is below. If I try to use the scrollTop property, I get
warnings on getElementById (cannot convert from Element to __body0), and
tagName (cannot be resolved or is not a field), and on appendChild (the
function appendChild is undefined for the type __body0). With the usage
of scrollTop commented out, there are no errors or warnings in the code.
I tried re-ordering the support libraries, but that then gave errors on
most of the DOM functions.
What am I missing to be able to use scrollTop without error?
Thanks very much,
John
--------------------
var article = ["Hey there!", "Hi there!", "Ho there!"];
function start() {
var body = document.getElementById('body');
var name = body.tagName;
// body.scrollTop = 0; // remove comment on line
body.appendChild(document.createTextNode("Body is a: " + name));
for ( var i = 0; i < article.length; i++) {
var listitem = document.createElement('div');
listitem.appendChild(document.createTextNode(article[i]));
body.appendChild(listitem);
}
}
|
|
|
Re: JSDT syntax errors [message #227351 is a reply to message #227151] |
Tue, 27 January 2009 16:46 |
|
John Dance wrote:
> I'm trying to use the JavaScript tools in Eclipse 3.4.1 for the first
> time. I've created a JavaScript project, I've enabled "Web Based
> JavaScript Support", and I've added the FireFox Browser Support Library
> to my libraries.
>
> I get spurious errors from the JavaScript editor when I use a property
> that is not part of the ECMA 3 Browser Support library Element, but it
> is specified in the FireFox Browser Support Library
> HTML[Html|Body|Head|Script]Element.
> The example is below. If I try to use the scrollTop property, I get
> warnings on getElementById (cannot convert from Element to __body0), and
> tagName (cannot be resolved or is not a field), and on appendChild (the
> function appendChild is undefined for the type __body0). With the usage
> of scrollTop commented out, there are no errors or warnings in the code.
>
> I tried re-ordering the support libraries, but that then gave errors on
> most of the DOM functions.
>
> What am I missing to be able to use scrollTop without error?
> Thanks very much,
> John
>
> --------------------
>
> var article = ["Hey there!", "Hi there!", "Ho there!"];
>
> function start() {
>
> var body = document.getElementById('body');
> var name = body.tagName;
>
> // body.scrollTop = 0; // remove comment on line
>
> body.appendChild(document.createTextNode("Body is a: " + name));
> for ( var i = 0; i < article.length; i++) {
> var listitem = document.createElement('div');
> listitem.appendChild(document.createTextNode(article[i]));
> body.appendChild(listitem);
> }
> }
You're not missing anything, we're working through as many of these
scenarios as we can, as fast as we can. This one is bug 244760.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=244760
--
---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
|
Powered by
FUDForum. Page generated in 0.03444 seconds