eltharin / juniorjs
JuniorJS Bundle for symfony
V1.2.3
2024-06-01 12:40 UTC
README
Junior JS 库
JR.ajax(url, options = {})
调用 Ajax 查询
管理事件
JR.Events.add (eventName, elementSelector, handler)
允许在 HTML 元素上添加事件,但放置在文档根目录以允许在最新元素上分发事件
JR.Events.dispatch(eventName, element, options = {})
分发事件
管理弹出窗口
let popup = new JR.Popup();
popup.load(data);
创建一个弹出窗口
在链接上设置 class openpopup 允许您以不同的方式调用链接
简单点击打开嵌入页面的弹出窗口或中间点击打开新页面
您必须设置带有条件的模板
{%- if app.request.headers.get('X-Requested-With') != 'XMLHttpRequest' -%}
<!DOCTYPE html>
<html>
<head>
...
{%- endif -%}
看看我的其他插件 Ajaxresponser,它允许以 Ajax 模式响应路由(带有消息、错误、成功等的 JSON 或 HTML 页面)