Hi corbacho,

i have change a little bit your code.
This will implement the G+ API better, directly in the head of html.

All change can you see in the attachment.

CommentFileSizeAuthor
google_plusone.patch1.63 KBchristian death
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

corbacho’s picture

Status: Active » Postponed

True, it looks cleaner using an array to build the script element, and then calling drupal_render on it. Instead of concatenating. But this is only for D7 and for the non-async script option. By now, I prefer to keep it as it is, so it's easier to maintain common code in D7 and D6 modules.

Other thing: It's not good idea to print script tags with drupal_add_html_head for performance reasons. This kind of non-important JavaScript should be printed in the bottom of the page, for the sake of those browsers where still the JavaScript loading blocks the rendering of the page.

I will have it in mind for the future
Thanks for the suggestion Christian