rocket / script
Enqueue scripts, take control of your Javascript
Installs: 171
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Language:JavaScript
Requires
- php: >=5.5.0
This package is auto-updated.
Last update: 2023-08-16 18:38:42 UTC
README
In modern web applications, script execution should be done at the end of a page's loading. This class is a very simple wrapper for this: queue scripts and render them when needed
Install
Via Composer
$ composer require rocket/script
Service Provider
\Rocket\UI\Script\Support\Laravel5\ServiceProvider
Middleware
(App\Http\Kernel.php)
\Rocket\UI\Script\Support\Middleware\ScriptMiddleware
Usage
JS::ready(' console.log("you\'re a wizard, Harry!"); '); JS::ready(' console.log("Dobby is freeeee!"); ');
Will produce
<script> $(function() { console.log("you're a wizard, Harry!"); //--- console.log("Dobby is freeeee!"); }); </script>
Testing
All the tests live in the main project.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.