![]() ![]() With common JS you could do something like this const oldswal = require('/my-local-js-directory/sweetalert.1.5.1.js')Ĭonst newswal = require('/my-local-js-directory/sweetalert.2.1.0. Import swal as newswal from '/my-local-js-directory/sweetalert.2.1.0.js' Import swal as oldswal from '/my-local-js-directory/sweetalert.1.5.1.js' 'js/', array(), $this->version, false ) Īnd update any references targeting old SweetAlert code according to the migration documentationĪlternatively If you want to use both libraries concurrently you could utilise ES6 modules with a compiler such as babel // Javascript ECMAScript versions include ES1, ES2, ES3, ES5, and ES6. Releasing a new edition of ECMAScript does not mean that all JavaScript engines in existence suddenly have those new features. If you will recall, ECMAScript is a specification for what a scripting language could look like. ECMAScript is the official language name. Ready to try JavaScript Begin learning here by typing in your first name surrounded by quotation marks, and ending with a semicolon. JavaScript versions are not mentioned here. Wp_enqueue_script( 'sweet-alert-latest', plugin_dir_url( _FILE_ ). JavaScript was invented by Brendan Eich, and in 1997 and became an ECMA standard. To prevent this only load one library such as: // PHP Therefore if you load both js/ and js/ the first one to define the global swal will be used, the second will be ignored or cause a console error. The JavaScript Versions A client-side programming language is JavaScript which indicates that it is active in the user’s browser. ![]() Sweetalert.js uses the global swal in both version 1.*.* and version 2.*.* of its library. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |