{"id":19860390,"url":"https://github.com/sarahelsaig/jquery-fetch","last_synced_at":"2025-05-02T04:30:22.719Z","repository":{"id":97799291,"uuid":"147643814","full_name":"sarahelsaig/jquery-fetch","owner":"sarahelsaig","description":"A promise based wrapper around jQuery that dynamically picks between get and post and implements validation and error reporting.","archived":true,"fork":false,"pushed_at":"2019-12-02T16:54:28.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T00:12:13.920Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"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/sarahelsaig.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-09-06T08:41:34.000Z","updated_at":"2024-05-31T15:32:02.000Z","dependencies_parsed_at":"2023-03-26T13:50:42.109Z","dependency_job_id":null,"html_url":"https://github.com/sarahelsaig/jquery-fetch","commit_stats":null,"previous_names":["sarahelsaig/jquery-fetch"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarahelsaig%2Fjquery-fetch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarahelsaig%2Fjquery-fetch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarahelsaig%2Fjquery-fetch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarahelsaig%2Fjquery-fetch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sarahelsaig","download_url":"https://codeload.github.com/sarahelsaig/jquery-fetch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251986608,"owners_count":21675950,"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-12T15:05:35.005Z","updated_at":"2025-05-02T04:30:22.464Z","avatar_url":"https://github.com/sarahelsaig.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# jquery-fetch\nA promise based wrapper around jQuery that dynamically picks between get and post and implements validation and error reporting.\n\n## Download\nFind in [Releases](https://github.com/DAud-IcI/jquery-fetch/releases) or just inlcude from cdnjs:\n```javascript\n\u003cscript src=\"https://cdn.jsdelivr.net/gh/daud-ici/jquery-fetch@v0.3/jquery-fetch.min.js\"\u003e\u003c/script\u003e\n```\n\n\n## Configuration\nSimply include it into your headers below jQuery.\nYou can specify a prefix message in the error notification by creating jQuery.fetch as an object prior to importing the library:\n```html\n\u003cscript\u003e jQuery.fetch = { fn_text: \"There has been an error:\", do_globals: true }; \u003c/script\u003e\n```\nIf `do_globals` is true it will export the utility functions into window too:\n* delayelay\n* animatenimate\n* notifyotify\n* error_fnrror_fn\n* error_alertrror_alert\n* error_notifyrror_notify\n* error_absorbrror_absorb\n* error_makeAlertWithIdrror_absorb\n\n## Usage\n```javascript\njQuery.fetch('url', post_data, condition)\n    .then(result =\u003e do_something_with(result))\n    .catch(jQuery.fetch.error.notify);\n```\n\n* url and post_data behave the same way as with jQuery.post, if post_data is undefined then jQuery.get will be used\n* condition may be either a function or an object\n  - If it's a function then `condition(result)` will be called. The promise gets resolved if the function's return value is truthy, rejected otherwise.\n  - if it's an object then each property gets compared with the result independently.\n  - If it's null or undefined then no validation is done.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarahelsaig%2Fjquery-fetch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsarahelsaig%2Fjquery-fetch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarahelsaig%2Fjquery-fetch/lists"}