The JavaScript and jQuery community documentation page http://drupal.org/node/171213 seems to be the primary documentation for this topic.

There is also this JavaScript Startup Guide from the Drupal API: http://api.drupal.org/api/drupal/developer!topics!javascript_startup_gui...

At first glance the guide looks a bit broad, covering all sorts of very basic js topics that would seem out of scope for Drupal docs, but it does a great job of clarifying how these concepts relate to Drupal. For example, it sheds some light on the relationship between $(document).ready() and Drupal behaviors, a topic which has fueled much confusion in the comments on the main js and jQuery community docs page.

It would be great to make both of these pages easier to find. For the main js docs page, some users might not understand that the theming guide is the right place to look and not, say, the site building guide. Maybe moving it up to the top level inside the guide would help, and it would consolidate community discussion on the topic, too.

Also, it's not clear to me whether the Drupal community wants documentation like that JavaScript Startup Guide to belong in the API, but the page doesn't seem to have any navigation pointing to it, and was even pretty hard to google. Can we try moving it to the community docs? At the very least, adding a link to it from the main js documentation page would give users some context for how to apply the information on that page.

Comments

jhodgdon’s picture

Yes, please -- feel free to take the page at http://api.drupal.org/api/drupal/developer!topics!javascript_startup_gui... and put it into the Community Docs. I actually didn't even know that page was there on api.drupal.org -- doesn't belong there at all. Post here when you've done that, and we'll remove it from api.drupal.org and replace with a redirect to its new home.

If you think that the page at http://drupal.org/node/171213 and the newly-created page from the one currently on api.drupal.org should be somewhere else, I would be happy to move it (or you can, if you have permission -- I can't remember if everyone has permission to move pages or if you have to be an admin). Or perhaps propose a location here so we can discuss it?

Thanks for taking an interest in this documentation!

leehunter’s picture

There's also comprehensive information on Javascript in the developer guide at http://drupal.org/node/121997 which probably has most or all of the information that's found on that API page. The heading in the Dev Guide said "JavaScript in Drupal 5 and Drupal 6" but since the content seems to have been updated for Drupal 7 (and most of the information wouldn't be specific to a Drupal version anyway) I renamed it to "Working With Javascript".

I've also moved the Javascript info in the Theming Guide up a level and changed the heading to Working With Javascript (so that it nw appears immediately after "Working with CSS"). I've also added an cross reference to the info in the dev guide mentioned above.

I suspect that http://api.drupal.org/api/drupal/developer!topics!javascript_startup_gui... can probably be deleted.

quietone’s picture

Status: Active » Closed (won't fix)

This is concerning Drupal 7 documentation, which is EOL.