1.0.3 • Published 8 months ago

inline-script v1.0.3

Weekly downloads
-
License
-
Repository
-
Last release
8 months ago

inline-script

inline-script is so small library let's use write your javascript code inline with script="" attribute. It's has no opinion to how to utilize your code with whatever dom manipulation tool (jquery, cash etc.)

inline-script is second stepping to complete hypermedia api's to have "islands of interacivity". We could also call this hypermedia friendly scripting.

There are already solutions to this "hyperscript" by htmx, "surreal" by gnat and also "Alpine.js" by calebporzio. They are great. They all have their unique styles to do dom manipulations.

inline-script is just like onclick, obdblclick events. it is just script attribute with this represents the element itself like this to onclick. So you can wrap $(this) with jquery, jquery-like or whatever library and use it for all your needs.

Usage

<script src="https://www.unpkg.com/inline-script"></script>

inline-script can be used by cdn or by downloading.

<h1 script="getWeatherOf([39.9, 32.8]).then(data => this.textContent =data.current_weather.temperature + '°C')"></h1>

Glossary

WIP

Size

Sizeinline-script
Unminified1.4 KB
Minified470 B
Minified & Gzipped330 B
1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago