{"_id":"e-ajax","_rev":"6-bc52483d661f9fcd546b0b5292303200","name":"e-ajax","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.3":{"name":"e-ajax","version":"1.0.3","keywords":["jquery","ajax","forms","declarative","unobtrusive","form-validation","retry","debounce"],"author":{"name":"RamonDev - Adeyemi Abdulramon"},"license":"MIT","_id":"e-ajax@1.0.3","maintainers":[{"name":"ramondev180","email":"ramondev.business@gmail.com"}],"homepage":"https://github.com/ramondev180/e-ajax#readme","bugs":{"url":"https://github.com/ramondev180/e-ajax/issues"},"dist":{"shasum":"0dd6a2572b185a541ce9da99afa2dbdd87b4bd66","tarball":"https://registry.npmjs.org/e-ajax/-/e-ajax-1.0.3.tgz","fileCount":6,"integrity":"sha512-g/meLjbPVHAaPZoXgmCdeUbCxMahf63lqP7MLPVyuGe7z0Ay7oM7cFpCatepIZT5QhgulHWgBBwEn/5T/E+O+w==","signatures":[{"sig":"MEUCIQCCfn+9mqZj0KzHXPST7HTF5u2rIs2Mhd/RUl8mc8sPRQIgUZCCW6DIOSMSYTK979FgswAbzBYN6g2rWjcGFVA+w8Q=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":46694},"main":"dist/e-ajax.js","unpkg":"dist/e-ajax.min.js","engines":{"node":">=14"},"scripts":{"build":"node build.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"ramondev180","email":"ramondev.business@gmail.com"},"jsdelivr":"dist/e-ajax.min.js","repository":{"url":"git+https://github.com/ramondev180/e-ajax.git","type":"git"},"_npmVersion":"11.6.1","description":"Declarative AJAX for jQuery forms and elements via e-ajax-* attributes — loading states, retries, debounce, abort-on-resubmit, inline field errors, no $.ajax() boilerplate.","directories":{},"_nodeVersion":"24.11.0","_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.23.0"},"peerDependencies":{"jquery":">=1.9.0"},"_npmOperationalInternal":{"tmp":"tmp/e-ajax_1.0.3_1786780574404_0.10985075181703863","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"e-ajax","version":"1.0.4","description":"Declarative AJAX for jQuery forms and elements via e-ajax-* attributes — loading states, retries, debounce, abort-on-resubmit, inline field errors, no $.ajax() boilerplate.","license":"MIT","main":"dist/e-ajax.js","unpkg":"dist/e-ajax.min.js","jsdelivr":"dist/e-ajax.min.js","keywords":["jquery","ajax","forms","declarative","unobtrusive","form-validation","retry","debounce"],"homepage":"https://github.com/ramondev180/e-ajax#readme","repository":{"type":"git","url":"git+https://github.com/ramondev180/e-ajax.git"},"bugs":{"url":"https://github.com/ramondev180/e-ajax/issues"},"author":{"name":"RamonDev - Adeyemi Abdulramon"},"peerDependencies":{"jquery":">=1.9.0"},"devDependencies":{"esbuild":"^0.23.0"},"scripts":{"build":"node build.js","prepublishOnly":"npm run build"},"engines":{"node":">=14"},"gitHead":"a03f2d79eeb03f164adc8fceadd92fe236b06c68","_id":"e-ajax@1.0.4","_nodeVersion":"24.11.0","_npmVersion":"11.6.1","dist":{"integrity":"sha512-lRN8BzgmwIUNcRpdT4sxvE0TPfCT8LZrBf4khwir70y2QvoYJo0WwOCreartAkvP9Wk070aTMpK6XuPHOrRgSg==","shasum":"f5f700d46e93cca7245cae7e033615b42a7e9774","tarball":"https://registry.npmjs.org/e-ajax/-/e-ajax-1.0.4.tgz","fileCount":6,"unpackedSize":62811,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDU5FIH9qS32qCgly4aNbBEk2Gw5qFwIa40Q1/Z5EDo8QIhAOIJb/vXacpIWuwKQaaUSKlh6JhqXxXJ/GPCogtSzt7P"}]},"_npmUser":{"name":"ramondev180","email":"ramondev.business@gmail.com"},"directories":{},"maintainers":[{"name":"ramondev180","email":"ramondev.business@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/e-ajax_1.0.4_1786787286175_0.052749733425844436"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-15T07:56:14.334Z","modified":"2026-08-15T09:48:06.488Z","1.0.0":"2026-08-11T11:53:21.642Z","1.0.1":"2026-08-13T17:25:36.930Z","1.0.2":"2026-08-13T17:39:57.165Z","1.0.3":"2026-08-15T07:56:14.534Z","1.0.4":"2026-08-15T09:48:06.325Z"},"bugs":{"url":"https://github.com/ramondev180/e-ajax/issues"},"author":{"name":"RamonDev - Adeyemi Abdulramon"},"license":"MIT","homepage":"https://github.com/ramondev180/e-ajax#readme","keywords":["jquery","ajax","forms","declarative","unobtrusive","form-validation","retry","debounce"],"repository":{"type":"git","url":"git+https://github.com/ramondev180/e-ajax.git"},"description":"Declarative AJAX for jQuery forms and elements via e-ajax-* attributes — loading states, retries, debounce, abort-on-resubmit, inline field errors, no $.ajax() boilerplate.","maintainers":[{"name":"ramondev180","email":"ramondev.business@gmail.com"}],"readme":"# e-ajax\r\n\r\nDeclarative AJAX for jQuery forms and elements — add `e-ajax-*` attributes to your HTML instead of hand-writing `$.ajax()` boilerplate for every form.\r\n\r\nHandles loading states, input disabling, retries with backoff, debouncing, abort-on-resubmit, confirmation prompts (native or custom), and inline per-field error rendering — declaratively or from JS.\r\n\r\n> **Browser-only.** This runs in the browser and requires jQuery + the DOM. It's published on npm so it works with bundlers and CDNs — it does not run in Node.js.\r\n\r\n## Install\r\n\r\n```bash\r\nnpm install e-ajax jquery\r\n```\r\n\r\nor drop it straight in with no build step:\r\n\r\n```html\r\n<script src=\"https://code.jquery.com/jquery-3.7.1.min.js\"></script>\r\n<script src=\"https://cdn.jsdelivr.net/npm/e-ajax/dist/e-ajax.min.js\"></script>\r\n```\r\n\r\n## Quick start\r\n\r\n```html\r\n<form e-ajax-init\r\n      e-ajax-key=\"loginForm\"\r\n      e-ajax-url=\"/api/login\"\r\n      e-ajax-method=\"POST\"\r\n      e-ajax-event=\"submit\"\r\n      e-ajax-onSuccess=\"handleLoginSuccess\">\r\n  <input type=\"email\" name=\"email\" />\r\n  <input type=\"password\" name=\"password\" />\r\n  <button type=\"submit\">Log in</button>\r\n</form>\r\n\r\n<script>\r\n  function handleLoginSuccess(response) {\r\n    console.log(\"Logged in:\", response);\r\n  }\r\n</script>\r\n```\r\n\r\nThat's it — no JS wiring required. The form serializes itself, POSTs to `/api/login` on submit, and calls `handleLoginSuccess` with the parsed response. Native form submission (the page redirect) is prevented automatically.\r\n\r\n## Why\r\n\r\nMost jQuery AJAX code is the same handful of concerns rewritten per form: prevent default, serialize, disable inputs while sending, show a loading state on the button, render field errors from the response, re-enable on completion. `e-ajax` handles all of that from attributes on the element itself, while still giving you `onValidate`, `onSuccess`, `onError`, etc. as escape hatches for actual business logic.\r\n\r\n## Features\r\n\r\n- Zero-JS declarative binding via `e-ajax-init` + `e-ajax-*` attributes\r\n- Programmatic equivalent via `makeAjaxOnElement(selector, event, options)`\r\n- Client-side `onValidate` hook — return `false` to cancel, or an errors object to cancel **and** render field errors automatically\r\n- Native or fully custom confirmation dialogs (`e-ajax-confirm` / `e-ajax-onConfirm`)\r\n- Automatic retry with exponential backoff on network failure / 5xx (never on 4xx or abort)\r\n- Debounce, and abort-previous-request-on-resubmit\r\n- Inline per-field error rendering from server responses (`e-ajax-error` / `e-ajax-for`)\r\n- Button loading-state swapping, input disabling while in flight\r\n- File uploads with upload progress callback\r\n\r\n## Docs\r\n\r\nFull attribute reference, the `makeAjaxOnElement` API, and recipes (file upload with progress, custom confirmation modals, live search, retry, field-level validation) are in [`DOCS.md`](./DOCS.md).\r\n\r\n## License\r\n\r\nMIT\r\n","readmeFilename":"README.md"}