Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » JSDT syntax errors
JSDT syntax errors [message #227151] Sat, 24 January 2009 01:13 Go to next message
No real name is currently offline 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 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2314
Registered: July 2009
Senior Member
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 WTP, IBM
Re: JSDT syntax errors [message #227372 is a reply to message #227351] Tue, 27 January 2009 18:05 Go to previous message
John Dance is currently offline John Dance
Messages: 10
Registered: July 2009
Junior Member
Nitin Dahyabhai wrote:

> 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

Thanks Nitin. I'll add some test cases to the bug you reference.
Previous Topic:axis2 automatically redeploy?
Next Topic:Can Ganymede generate a build.xml for an ear file?
Goto Forum:
  


Current Time: Fri Oct 31 05:02:42 GMT 2014

Powered by FUDForum. Page generated in 0.21962 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software