Javascript code comments, global namespace
fajerstarter - November 23, 2006 - 21:50
| Project: | Double Click |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Not adding to the global namespace is always a good idea. E.g using closures or adding functions to an dblclick object.
drupal_add_js('settings') could also be used instead of drupal_add_js('inline').

#1
I try to be conservative with code comments in JS as they add to the download file size to the browser. But, that being said, I probably could stick a little more in there.
As for using the global JS settings provided by Drupal, yes, I should really do that. I wasn't aware of it when I wrote the script. I'll put it on my to-do list.
And if you'd like to whip up a patch, I'd be happy to integrate it.
#2
Fixes committed to HEAD.
#3