{"id":19443746,"url":"https://github.com/aretecode/aj","last_synced_at":"2025-04-25T00:32:40.290Z","repository":{"id":58213713,"uuid":"37873876","full_name":"aretecode/aj","owner":"aretecode","description":"Smallest \u0026 fastest ajax library with differentiations according to the use case.","archived":false,"fork":false,"pushed_at":"2015-10-08T17:29:14.000Z","size":352,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-18T07:28:41.964Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aretecode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-22T18:43:39.000Z","updated_at":"2025-02-19T18:51:37.000Z","dependencies_parsed_at":"2022-09-05T11:00:47.841Z","dependency_job_id":null,"html_url":"https://github.com/aretecode/aj","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aretecode%2Faj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aretecode%2Faj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aretecode%2Faj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aretecode%2Faj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aretecode","download_url":"https://codeload.github.com/aretecode/aj/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250733529,"owners_count":21478384,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T15:44:04.248Z","updated_at":"2025-04-25T00:32:40.021Z","avatar_url":"https://github.com/aretecode.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aj(ax)\n[![Build Status](https://secure.travis-ci.org/aretecode/aj.svg)](https://travis-ci.org/aretecode/aj)\n[![License](https://img.shields.io/badge/licence-MIT-brightgreen.svg)](https://github.com/aretecode/aj/blob/master/LICENSE)\n[![Bower version](https://badge.fury.io/bo/aj.svg)](https://badge.fury.io/bo/aj)\nSmallest \u0026 fastest ajax library, made modular.\n\n## small \u0026 fast\nTiny size \u0026 blazing performance. \n* codegolf: 173 bytes gzipped (218 bytes uncompressed)\n* Param: 662 bytes gzipped \n* Param.ez: 284 bytes gzipped -if you copy it into an independent function- (408 bytes uncompressed)\n\n## why\nWhen you want to do ajax but don't want to use an entire library like jquery...\nWhen you do a lot of requests... each bit of overhead counts.\nInclude and use the ones you want.\n\n## terminology\n* _param_ = parameter\n* _aj_ = short form of ajax\n* _G_ = short for Get\n* _P_ = short for Post\n\n## installation\nUsing bower:\n```\nbower install aj --save\n```\n\nOr, download the files, and include them however you like.\n\n\n\n## parameter\nGet your Data ready for the aj(ax) request, from a form elements (```html \u003cselect\u003e, \u003cinput type=checkbox|text|any\u003e```, from js anonymous objects, or form elements and objects mixed.# example\n\n## examples\nSee [examples/] for more\n\nOur HTML\n```html\n\u003cform method=\"POST\"\u003e\n    \u003clabel for=\"pickle\"\u003eCategory\u003c/label\u003e\n    \u003cselect name=\"pickle\" id=\"pickle\" class=\"ajable selects\"\u003e\n        \u003coption\u003eickleme-tickleme-pickleme\u003c/option\u003e\n        \u003coption selected\u003eickleme-tickleme-pickleme-too\u003c/option\u003e\n        \u003coption\u003eickleme-tickleme-pickleme-shoe\u003c/option\u003e\n    \u003c/select\u003e\n    \u003cinput type=\"text\" name=\"textual_input_input\" id=\"textual_input_input\" class=\"ajable inputs\" value=\"textTestValue\"/\u003e\n    \u003cinput type=\"num\" name=\"numerical_input_example\" id=\"numerical_input_example\" class=\"ajable inputs\" value=\"42\"/\u003e\n    \u003cinput type=\"checkbox\" name=\"checkbox_input\" id=\"checkbox_input\" class=\"ajable\" checked/\u003e\n\n    \u003cp\u003e\u003cinput type=\"radio\" name=\"answer\" value=\"true\" class=\"ajable radios\" checked=\"checked\"\u003eTrue\u003c/p\u003e\n    \u003cp\u003e\u003cinput type=\"radio\" name=\"answer\" value=\"false\" class=\"ajable radios\"\u003eFalse\u003c/p\u003e\n\n    \u003cinput type=\"button\" onclick=\"exampleAjax();\" id=\"submit_button\" value=\"submit_button\"/\u003e\n\u003c/form\u003e\n```\n\nThe JS\n```js \n// Params\nvar ajable = document.getElementsByClassName(\"ajable\");    \nvar dataurl = Params.elements(ajable); // pb.elements(ajable).get();\n\n// aj(ax) Post\najP({\n    url: \"ajax.php\",\n    data: params,\n    listeners:  {\n        // some example ones to listen for \n        404: function(result){console.log(result); console.log(\"404\");},\n        201: function(result){console.log(result); console.log(\"201\");},\n        200: function(result){console.log(result); console.log(\"200\");},\n        303: function(result){console.log(result); console.log(\"303\");},\n        other: function(result){console.log(result); console.log(\"other\");},\n        done: function(result){console.log(result); console.log(\"done\");}\n    }\n});\n\n```\n\n\n## @TODO:\n* [ ] username \u0026 password\n* [x] remove json dependency\n* [ ] Use http://httpstatus.es/\n* [x] readyState listener\n* [x] change names to shorter\n* [x] use bower\n* [x] use chai\n* [x] use mocha \n* [x] write tests  \n* [ ] would be nice to have paramsBuilder not add \"\u0026\" since the `s` functions already strip it out...\n* [ ] put on CDN\n* [x] recalculate minified size\n* [ ] put up min version again\n\nP.S.\nSupport can be added, in IE cache \u0026 parsing json \u0026 xml might have problems. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faretecode%2Faj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faretecode%2Faj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faretecode%2Faj/lists"}