Deferring JavaScript

Creating and modifying plugins.
Post Reply
User avatar
Posts: 7092
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany

Re: Deferring JavaScript

Post by yellowled » Thu Apr 27, 2017 1:34 pm

HiCotN wrote:Is there currently a way to defer the javascript for the Lightbox plugin? If not, would it be hard to implement?
Not sure what exactly you mean or what you are trying to achieve by this?

Technically, HTML5 offers the defer and aync attributes to optimize script loading, and it should be possible to add them as options to the plugin config. The “issue” is that this is a plugin.

By that I mean that it a) runs in very different settings (blogs, other plugins etc.) and b) includes multiple lightbox scripts that may or may not work well with to those attributes. So using these attributes should be optional and be decided by the user, not be a default setting.

It would need a developer to implement and (more importantly) test this, but it should not be hard to implement.

amazon Wishlist - Serendipity-Podcast (German only, sorry)

Posts: 375
Joined: Thu Oct 26, 2006 2:38 pm
Location: Stuttgart, Germany

Re: Deferring JavaScript

Post by thh » Sun Oct 15, 2017 2:14 pm

Thanks for your suggestion.

I have opened a pull request at with a wording similar to what you suggested.

Post Reply