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
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

jjeff - November 24, 2006 - 19:09

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

jjeff - November 25, 2006 - 00:40
Status:active» fixed

Fixes committed to HEAD.

#3

Anonymous - December 9, 2006 - 00:45
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.