{"id":19430360,"url":"https://github.com/demonicious/vjax","last_synced_at":"2025-02-25T05:43:14.886Z","repository":{"id":143988450,"uuid":"242555809","full_name":"Demonicious/vjax","owner":"Demonicious","description":"Vanilla JavaScript AJAX but not tedious.","archived":false,"fork":false,"pushed_at":"2024-03-20T01:18:17.000Z","size":20,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-07T20:13:53.941Z","etag":null,"topics":["ajax","js","library"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Demonicious.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,"governance":null}},"created_at":"2020-02-23T16:59:13.000Z","updated_at":"2024-03-20T01:17:30.000Z","dependencies_parsed_at":"2023-10-13T09:56:02.416Z","dependency_job_id":null,"html_url":"https://github.com/Demonicious/vjax","commit_stats":null,"previous_names":["mudassarislam/vjax","demonicious/vjax"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Demonicious%2Fvjax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Demonicious%2Fvjax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Demonicious%2Fvjax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Demonicious%2Fvjax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Demonicious","download_url":"https://codeload.github.com/Demonicious/vjax/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240612536,"owners_count":19829027,"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":["ajax","js","library"],"created_at":"2024-11-10T14:24:37.306Z","updated_at":"2025-02-25T05:43:14.839Z","avatar_url":"https://github.com/Demonicious.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### VJAX\nVanilla JavaScript AJAX but not as messy. 4KB File Size (Minified). \nSimilar to jQuery AJAX.\nBuilt as an educational project.\n\n### CDN (jsDelivr)\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/gh/Demonicious/vjax@latest/lib/vjax.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/gh/Demonicious/vjax@latest/lib/vjax.js\"\u003e\u003c/script\u003e\n```\n\n### Usage\n```javascript\nlet request = vjax.request({\n    url: 'somewhere.com',\n    method: 'POST',\n    data: {\n        id: 5,\n    },\n    preProcess: () =\u003e {\n        console.log('About to send request');\n    },\n    onSend: () =\u003e {\n        console.log('Request Sent');\n    },\n    onProgress: () =\u003e {\n        console.log('Request is being Processed.');\n    },\n    onResponse: (response) =\u003e {\n        console.log('Plain Text: ', response.text);\n        console.log('JSON: ', response.json);\n    },\n    onAbort: () =\u003e {\n        console.log('Request Aborted');\n    },\n    onError: (e) =\u003e {\n        console.error(e);\n    }\n});\n\n// All Lifecycle Methods are Optional.\n\n// Alternative Methods :-\n// - Parameters, Same as Above excluding \"method\" Property\nvjax.get();\nvjax.post();\n```\n\n### Basic Example\n```html\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n    \u003ctitle\u003eVJAX Test\u003c/title\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n    \u003cdiv class=\"container\"\u003e\n        \u003cbutton id=\"call_api\"\u003eCall API!\u003c/button\u003e\n        \u003cpre id=\"response\"\u003e\u003c/pre\u003e\n    \u003c/div\u003e\n    \u003cfooter\u003e\n        \u003cscript src=\"https://cdn.jsdelivr.net/gh/Demonicious/vjax@latest/lib/vjax.min.js\"\u003e\u003c/script\u003e\n        \u003cscript type=\"text/javascript\"\u003e\n            const btn = document.getElementById('call_api');\n            const resArea = document.getElementById('response');\n            btn.onclick = () =\u003e {\n                const request = vjax.request({\n                    url: 'https://jsonplaceholder.typicode.com/todos/',\n                    method: 'GET',\n                    data: {\n                        _limit: 5,\n                    },\n                    preProcess: () =\u003e {\n                        console.log('About to send request!');\n                    },\n                    onSend: () =\u003e {\n                        resArea.innerText = 'Sent Request!';\n                    },\n                    onProgress: () =\u003e {\n                        resArea.innerText = 'Request is being processed...';\n                    },\n                    onResponse: (response) =\u003e {\n                        resArea.innerText = response.text;\n                        console.log(response.json);\n                    }\n                });\n            }\n        \u003c/script\u003e\n    \u003c/footer\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdemonicious%2Fvjax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdemonicious%2Fvjax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdemonicious%2Fvjax/lists"}