rocket/script

This package is abandoned and no longer maintained. No replacement package was suggested.

Enqueue scripts, take control of your Javascript

Installs: 171

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Language:JavaScript

dev-master / 1.0.x-dev 2016-01-02 17:58 UTC

This package is auto-updated.

Last update: 2023-08-16 18:38:42 UTC


README

Latest Version Software License Build Status Coverage Status Quality Score Total Downloads

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.