I had problems when installing swftools and trying to get swfobject2 working in the status page. I realized that the script did not load ok, and then I saw al js files included at the bottom of the page instead of the header, and thus not being able to see flash in admin pages via swfobject2.

Is there any reason why in the theme, the $scripts are printed after the footer and before closure?

Thanks for the help.

Comments

Jackinloadup’s picture

This is also an issue for the gmap module. For google maps to load the javascript must be in the head and not the footer.

As odd as this is it seems putting scripts in the head would be the safest option.

Other ideas?

mcrittenden’s picture

It's generally recommended to put JS at the end of the page so that it won't be loaded until the rest of the page is finished, but seeing as this is conflicting with other modules, I'd also like it put in the header.

Jackinloadup’s picture

Maybe we could have a theme setting that would switch the placement of $scripts?

Thoughts?

rootwork’s picture

+1 on that

I like using the theme for content editing, so the out-of-the-box failure to render Google maps via location was pretty problematic. Instead of moving the $scripts printing to the top every time I update this module, it would be great to have an option to put it in one place or another.

By default, though, I think functionality should trump performance. So by default I think it should be at the top, with the option to put it at the bottom for performance, with the caveat that it might disrupt operation of Javascript rendering.

ldweeks’s picture

subscribing..

ejolivet’s picture

subscribing !

Anonymous’s picture

Assigned: Unassigned »
Status: Active » Fixed

moved $scripts var to head so we can play nice with others.

dboulet’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.