eltharin/juniorjs

JuniorJS Bundle for symfony

Installs: 64

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Language:JavaScript

Type:symfony-bundle

V1.4.5 2025-03-28 16:38 UTC

This package is auto-updated.

Last update: 2025-03-28 16:40:19 UTC


README

Junior JS Library

JR.ajax(url, options = {})

call an Ajax query

Manage Events

JR.Events.add (eventName, elementSelector, handler)

allow add an event on an HTML element but placed on document root to allow dispatching event on newest elements

JR.Events.dispatch(eventName, element, options = {})

dispatch the event

Manage Popup

let popup = new JR.Popup();
popup.load(data);

create a popup

set class openpopup on a link allow you to call differently a link,

simple clic open a popup with the page emedded or with a middle clic that open you a new page

you have to set your template with condition on

{%- if app.request.headers.get('X-Requested-With') != 'XMLHttpRequest' -%}
<!DOCTYPE html>
<html>
<head>
...
{%- endif -%}

take a look to my othr plugin Ajaxresponser allowing a route to be responded in ajaxmode (a json with message, errors, success, ...} or HTML page)