drupal_add_js(array('UserTitlesImageURL' => base_path() ."$path/delete.gif"), 'setting');
To make the array keys more unique(per module), it can be good to use:
array('userTitles' => array('imageURL' => base_path() ."$path/delete.gif"))
and access it in JS as: Drupal.settings.userTitles.imageURL
Really minor but couldn't resist. :P
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | user_titles5-task_js_array_structure_0.patch | 1.88 KB | Gurpartap Singh |
| user_titles5-task_js_array_structure.patch | 1.87 KB | Gurpartap Singh |
Comments
Comment #1
Gurpartap Singh commentedOops, the above patch included the other patch related to Delete image src path.
Comment #2
merlinofchaos commentedThanks!
Comment #3
(not verified) commented