[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.pdt] Re: javascript dependency

Matthew,

Unfortunately this isn't a problem with PDT per say. It is a problem with the way the project is setup in Eclipse and there is additional steps needed to make sure the Javascript interpreter knows that you are using jQuery. I am currently in the same process of getting Drupal projects JS files working with Eclipse. If you do a web search for "eclipse jquery" you will see some documentation on the topic. I haven't found a great step-by-step guide to do this setup yet. In the general sense you have to include the the javascript files within the misc directory as an included files to the project even if you aren't interacting with it directly. So jquery.js and drupal.js would be two files as included scripts available to the other javascript files.

If / when I find a good guide to getting jQuery working in Eclipse I will post it here.

--
Shawn Clark

Matthew Young wrote:
 Right now, when I open any js file, I get lots errors like this:

http://i6.photobucket.com/albums/y222/moyoungerman/post/js_error1.jpg
http://i6.photobucket.com/albums/y222/moyoungerman/post/js_error2.jpg

The javascript are part of some  Drupal PHP page, they are linked in
like this when the page is rendered:

<script type="text/javascript" src="/misc/jquery.js?9"></script>
<script type="text/javascript" src="/misc/drupal.js?9"></script>
<script type="text/javascript"
src="/sites/gsprint_devel/modules/thickbox/thickbox_auto.js?9"></script>
<script type="text/javascript"
src="/sites/gsprint_devel/modules/thickbox/thickbox.js?9"></script>

So how can I tell PDT drupal.js depends on jquery.js so it won't
complain $ is undefined?

On a line like this:

var Drupal = Drupal || { 'settings': {}, 'behaviors': {}, 'themes':
{}, 'locale': {} };


I get error: "The operator || is undefined for the argument type(s) __Drupal0, any"

This should be okay. Why am I getting this error?