Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Javascript libs not resolved
Javascript libs not resolved [message #229178] Wed, 18 March 2009 05:25 Go to next message
Frank Mising name is currently offline Frank Mising name
Messages: 6
Registered: July 2009
Junior Member
Hi,
I'm working under Eclipse Ganymede 3.4.2 and created a "Static Web
Project".
I've "added Javascript Support" by "rightClick-on-Project > Web
Development Tools"
Under ""rightClick-on-Project > Properties > JavaScript > JavaScript
Libraries > Source" I've added the two Google Gears js-Files gears_init.js
and js_utils.js. They show up in the "JavaScript Support"-area of the
project in "Script Explorer", which seems to be correct.

Afterwards I've created a HTML-file in WebContent named test.html an
copied some example code from Google into it. It starts with
<html>
<body>
<script type="text/javascript" src="../gears_init.js"></script>
<script type="text/javascript" src="../js_utils.js"></script>
<script type="text/javascript">
try {
detectPlatform();
} catch (e) {
document.write(e);
}
</script>
...

detectPlatform() is marked with red underline "The function
detectPlatform() is undefined", which is definitely wrong. detectPlatform
() is defined in js_utils.js. After exporting, everything works fine in
Tomcat. But why do I receive a lot of "The function xyz is undefined" and
"xyz cannot be resolved or is not a field" and why is autocompletion
turned off.

Seems to me, that I misunderstood the whole concept.

Any hints appreciated
Regards, Frank
Re: Javascript libs not resolved [message #229855 is a reply to message #229178] Mon, 30 March 2009 15:38 Go to previous message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2233
Registered: July 2009
Senior Member
Frank wrote:
> Hi,
> I'm working under Eclipse Ganymede 3.4.2 and created a "Static Web
> Project". I've "added Javascript Support" by "rightClick-on-Project >
> Web Development Tools"
> Under ""rightClick-on-Project > Properties > JavaScript > JavaScript
> Libraries > Source" I've added the two Google Gears js-Files
> gears_init.js and js_utils.js. They show up in the "JavaScript
> Support"-area of the project in "Script Explorer", which seems to be
> correct.
>
> Afterwards I've created a HTML-file in WebContent named test.html an
> copied some example code from Google into it. It starts with
> <html>
> <body>
> <script type="text/javascript" src="../gears_init.js"></script>
> <script type="text/javascript" src="../js_utils.js"></script>
> <script type="text/javascript">
> try {
> detectPlatform();
> } catch (e) {
> document.write(e);
> }
> </script>
> ..
>
> detectPlatform() is marked with red underline "The function
> detectPlatform() is undefined", which is definitely wrong.
> detectPlatform () is defined in js_utils.js. After exporting, everything
> works fine in Tomcat. But why do I receive a lot of "The function xyz is
> undefined" and "xyz cannot be resolved or is not a field" and why is
> autocompletion turned off.
>
> Seems to me, that I misunderstood the whole concept.
>
> Any hints appreciated

Sounds like a valid problem. Please open a bug report at
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=WTP%20So urce%20Editing&component=wst.jsdt
..

--
---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational


---
Nitin Dahyabhai
Eclipse WTP, IBM
Previous Topic:How to change the code in jar file
Next Topic:WSDL XSD and XML Catalog
Goto Forum:
  


Current Time: Wed Jul 23 04:06:54 EDT 2014

Powered by FUDForum. Page generated in 0.03051 seconds