Skip to content
ねゆんせ edited this page Jun 3, 2025 · 5 revisions

What's jlib?

This library is based on Jquery, because jquery is somewhat outdated is that this clone is born.

jlib works in the same way as jquery, however, many of the events or functions of jquery are not recreated here. Either to simplify the code, jlib is easy and fast to use.

Some examples

Html manipulation

Get the nav element and assign the class active

Jlib("nav").addClass("active")

Event handlers

A button when receiving the event click calls to a remote api and consumes from it the information, then it proceeds to paint it in html.

Jlib("button").event('click', async () => {

      const r = await Jlib().remote("https://api.sampleapis.com/coffee/hot").get();

      r.map(r => {
                  Jlib('#coffe').insertHTML(`<li><b>${r.title}:</b> ${r.description}</li>`)
            })

})

Remote

Using Remote call to an api using get() method

Jlib().remote("https://api.sampleapis.com/coffee/hot").get();
Clone this wiki locally