LABjs icon indicating copy to clipboard operation
LABjs copied to clipboard

Allow custom attributes to be passed in script() method

Open stubenbaines opened this issue 11 years ago • 1 comments

When integrating LABjs with some other frameworks, it would be useful to allow custom data attributes to be passed to the script() method which would then be output in the script tag. For example, the Gumby CSS framework specifies configuration options in the script tag's attributes. See http://www.gumbyframework.com/docs/javascript/#!/manual-initialization

Building on the Gumby example, would be useful to be able to load Gumby JS with LABjs and also specify attributes.

$LAB.script({
  "src" : "js/libs/gumby.js",
  "type" : "text/javascript",
  "attributes" : {
    "gumby-init" : "false"
  }
});

would result in a script tag being output as

<script gumby-init="false" src="js/libs/gumby.js"></script>

stubenbaines avatar Aug 13 '15 16:08 stubenbaines

This seems like a reasonable thing to consider for a future update.

getify avatar Jan 22 '16 02:01 getify