From: Nicolas Coden Date: Sun, 21 Oct 2018 14:36:19 +0000 (+0200) Subject: Use pull request #11545 from ncoden/docs/javascript-plugin-instanciation-element... X-Git-Tag: v6.5.0^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=847176607f8087a275db483f38ca1e948c87746c;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Use pull request #11545 from ncoden/docs/javascript-plugin-instanciation-element for v6.5.0 3a079659e docs: fix plugins instantiation examples in Javascript docs Signed-off-by: Nicolas Coden --- diff --git a/docs/pages/javascript.md b/docs/pages/javascript.md index dee81d779..07229ef6b 100644 --- a/docs/pages/javascript.md +++ b/docs/pages/javascript.md @@ -44,23 +44,23 @@ By default, Foundation is exported as [UMD modules](http://bob.yexley.net/umd-ja For example with [ES6](https://github.com/lukehoban/es6features#readme) (the ESM format): ```js import Foundation from 'foundation-sites'; -const $dropdown = new Foundation.Dropdown('#mydropdown'); +const $dropdown = new Foundation.Dropdown($('#mydropdown')); // Or import { Dropdown } from 'foundation-sites'; -const $dropdown = new Dropdown('#mydropdown'); +const $dropdown = new Dropdown($('#mydropdown')); ``` With [RequireJs](http://requirejs.org/) (the AMD format): ```js define(['foundation'], function(Foundation) { - var $dropdown = new Foundation.Dropdown('#mydropdown'); + var $dropdown = new Foundation.Dropdown($('#mydropdown')); }); ``` With [Node.js](https://www.safaribooksonline.com/library/view/learning-javascript-design/9781449334840/ch11s03.html) (the CommonJs format): ```js var Foundation = require('foundation-sites'); -var $dropdown = new Dropdown('#mydropdown'); +var $dropdown = new Dropdown($('#mydropdown')); ``` #### Available formats